Closed KarimJedda closed 2 years ago
No explicit reason; I had a bit of a dig and it turns out that the reason is because jsonrpsee
's HttpTransportClient
wants there to be an explicit port on the Uri
.
@niklasad1 would it make sense to default to 80/443 for http/https (or ws/wss) in jsonrpsee if no port is given, rather than expect one?
https://github.com/hyperium/http/issues/509
It's not possible to know whether the port number was missing or if the port number was faulty in that API but maybe it's possible to workaround that.
fwiw this also does not work:
subxt metadata -f bytes --url="wss://moonbeam.api.onfinality.io/public-ws:443" > meta.scale
Error:
0: Networking or low-level protocol error: Invalid URL: No port number in URL (default port is not supported)
1: Invalid URL: No port number in URL (default port is not supported)
@montekki, the port needs to be on the host part of the URL and not the full path ie:
wss://moonbeam.api.onfinality.io:443/public-ws
should be the right parameter.
@KarimJedda ah, true, thanks
@montekki yeah that one is tricky done that too many times :)
Given that this issue is really one of us not knowing whether an invalid port or no port was provided (see https://github.com/hyperium/http/issues/509), I'm going to close this for now since I don't think it's worth trying to do anything here at the mo (we'd have to do some parsing ourselves or something).
The following returns an error:
subxt metadata --url="wss://rpc.polkadot.io" -f bytes > metadata.scale
This works:
subxt metadata --url="wss://rpc.polkadot.io:443" -f bytes > metadata.scale
My question is: Is there a specific reason why the port number is required?
Thanks a lot