fixes ws rpc client bug: error when trying to connect to infura
fixes #109 previously, if using uri such as "wss://mainnet.infura.io/ws/v3/infura-id", the client will throw error. this bug already fixed in nim-websock, now this also fixed in json-rpc. it works when connected to infura wss.
This commit is contained in:
parent
a138c410c5
commit
318949a401
|
@ -78,16 +78,10 @@ proc connect*(client: RpcWebSocketClient, uri: string,
|
||||||
else:
|
else:
|
||||||
@[]
|
@[]
|
||||||
let uri = parseUri(uri)
|
let uri = parseUri(uri)
|
||||||
let secure = uri.scheme == "wss"
|
|
||||||
let port = parseInt(uri.port)
|
|
||||||
|
|
||||||
let ws = await WebSocket.connect(
|
let ws = await WebSocket.connect(
|
||||||
host = uri.hostname,
|
uri=uri,
|
||||||
port = Port(port),
|
factories=ext,
|
||||||
path = uri.path,
|
flags=flags
|
||||||
secure=secure,
|
|
||||||
flags=flags,
|
|
||||||
factories=ext
|
|
||||||
)
|
)
|
||||||
client.transport = ws
|
client.transport = ws
|
||||||
client.uri = uri
|
client.uri = uri
|
||||||
|
|
Loading…
Reference in New Issue