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

Can't connect to websockets #74

Open
kdzapp opened this issue Aug 23, 2023 · 7 comments
Open

Can't connect to websockets #74

kdzapp opened this issue Aug 23, 2023 · 7 comments

Comments

@kdzapp
Copy link

kdzapp commented Aug 23, 2023

For some reason our website when accessed through rammerhead can't connect to websockets when we host it ourselves, but this seems to be fixed in the closed source version.

Any insight into what's going on / what the fix might be?

@binary-person
Copy link
Owner

Are you doing nginx proxying? you need to enable websockets for it to work
https://www.nginx.com/blog/websocket-nginx/

@kdzapp
Copy link
Author

kdzapp commented Aug 23, 2023

We're using AWS's ALB which supports websockets, under the hood I believe this is exactly what it's doing

@kdzapp
Copy link
Author

kdzapp commented Aug 23, 2023

location / {
    proxy_pass          http://127.0.0.1:8080;
    proxy_http_version  1.1;

    proxy_set_header    Connection          $connection_upgrade;
    proxy_set_header    Upgrade             $http_upgrade;
    proxy_set_header    Host                $host;
    proxy_set_header    X-Real-IP           $remote_addr;
    proxy_set_header    X-Forwarded-For     $proxy_add_x_forwarded_for;
}

This is what our ec2s have on them

@binary-person
Copy link
Owner

can you make sure it's the nodejs app that's the issue by hosting a websocket test nodejs app?

@kdzapp
Copy link
Author

kdzapp commented Aug 23, 2023

hammerhead.js:1 WebSocket connection to 'wss://test.sunnyvale.gg/0e2f768f99dc421e80bd027f92a1f2c7!w!s*d1tm91r4ytbt54.cloudfront.net/https://us.sunnyvale.gg' failed:

this is the output, and yeah I can try make a small example (for reference, the websocket connection it's suppose to be making is wss://us.sunnyvale.gg

@kdzapp
Copy link
Author

kdzapp commented Aug 23, 2023

It's possible it has something to do with the websocket connection that's trying to be made is in an iframe?

@binary-person
Copy link
Owner

no, i meant instead of hosting rammerhead, can you host a small websocket test server in place of rammerhead?

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

2 participants