-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ws client] Failed to connect to sockaddr: 127.0.0.1:9944 with err: Rejected { status_code: 403 } #346
Comments
FWIW nmap shows the port open, although not sure if it means much since I am running against localhost zeke ~ % nmap -p T:9944 127.0.0.1
Starting Nmap 7.91 ( https://nmap.org ) at 2021-05-27 11:15 PDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00017s latency).
PORT STATE SERVICE
9944/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 0.07 seconds |
I good way to test that might be to have nmap within a cloud instance, and then targeting your ip from the outside. |
Also bumped jsonrpsee to alpha.7 and have the same issue
I don't want to expose it publicly though, just need a quick sanity check that the port is what I think it is |
Ahh I see what you are saying makes sense. |
Here is a minimal repo to reproduce the issue: https://github.com/emostov/ws-client-test/blob/master/src/main.rs Basically just start a polkadot node: And then within the repo |
Closing The issue was that I did not have the correct rpc-cors setting my polkadot node. Running the flag |
I took a look at this with @emostov and I think there's an actual issue here. Running a minimal
When I run So I think we have some kind of bug. Possibly there's a bug in The jsonrpsee logs:
|
I think I found what is causing this: https://github.com/paritytech/soketto/blob/38f5254ad230f2d16ea0d087be527abb21321500/src/handshake/client.rs#L143-L144 It seems like polkadot (i.e. To verify, I also used This fails to connect to my node: Vice versa, connecting from So this is a |
No, I don't think so. wscat sends the following:
jsonrpsee sends:
EDIT: |
I am trying to use the ws client via substrate's
remote-externalities
. I can connect fine towss://rpc.polkadot.io
and if I add.handshake_url("/public-ws".into())
to theWsClientBuilder
I can also connect towss://polkadot.api.onfinality.io/public-ws
.But if I try connecting to a local node,
ws://127.0.0.1:9944
, I get the following error:Exact error comes from here: https://github.com/paritytech/substrate/blob/fe9ced0c6048b45857e8806f8780a9a9a686421e/utils/frame/remote-externalities/src/lib.rs#L439-L443
I think
ws://127.0.0.1:9944
should be valid because I can use it to connect to the polkadot-js apps UIThe text was updated successfully, but these errors were encountered: