Skip to content
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 server]: doesn't reply with HTTP response on bad websocket HTTP upgrade request. #818

Closed
99Kies opened this issue Jul 7, 2022 · 6 comments

Comments

@99Kies
Copy link

99Kies commented Jul 7, 2022

parachain version: 0.9.22
start command:

parachain-node --collator --chain ksm-mainnet.json --base-path /data \
 --port 3033  --ws-port 9944 --unsafe-ws-external --rpc-cors all \
 -- --execution wasm --chain kusama.json

The previous websocket supports http access.
image

After upgrading to 22, websocket no longer supports http access.
image

@niklasad1
Copy link
Member

niklasad1 commented Jul 7, 2022

Hey @99Kies

Are you expecting a proper HTTP response to the HTTP request?
The request will fail to initiate the WebSocket handshake and it's just dropped on our side I think.

Should be quite easy to fix though, are you using this to find out when the websocket server has been started?

@niklasad1 niklasad1 changed the title After the parachain node is upgraded to 0.9.22, the websocket service no longer supports HTTP access. [ws server]: doesn't reply with HTTP response on bad websocket HTTP upgrade request. Jul 7, 2022
@99Kies
Copy link
Author

99Kies commented Jul 7, 2022

Hey @99Kies

Are you expecting a proper HTTP response to the HTTP request? The request will fail to initiate the WebSocket handshake and it's just dropped on our side I think.

Should be quite easy to fix though, are you using this to find out when the websocket server has been started?

Yes, we will try to check if the service is healthy via the HTTP protocol. I think this is also necessary.


We will regularly use this method to judge whether the service of 9944 is normal.

curl -ikv localhost:9944

@niklasad1
Copy link
Member

niklasad1 commented Jul 7, 2022

It's bit "expensive" to open a WS connection for that everytime.

Recently, we added server-side pings to WS Server which is enabled in polkadot v0.9.25. The server will send out a pings periodically every 30s if it's "healthy" and it might be easier for you to just listen on those instead of opening a new connection all the time.

However, we should fix it anyway thanks for reporting the issue.

@tinydjp
Copy link

tinydjp commented Jul 8, 2022

Hi @niklasad1 as we're using AWS to run our nodes, it seems that only ALB can support the wss protocol. In that case, ALB can only use HTTP(S) to run health check. We tried to use Network Load Balancer, the health check succeeded with TCP, but failed to connect via ws/wss.

@niklasad1
Copy link
Member

niklasad1 commented Jul 8, 2022

Alright, I see.

This will fixed by #819 anyway

@niklasad1
Copy link
Member

Closed by #819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants