Skip to content
This repository has been archived by the owner on Mar 16, 2022. It is now read-only.

Websocket connection not going through? #96

Open
coreyog opened this issue May 5, 2016 · 1 comment
Open

Websocket connection not going through? #96

coreyog opened this issue May 5, 2016 · 1 comment

Comments

@coreyog
Copy link

coreyog commented May 5, 2016

I'm trying to use rocky in conjunction with live-server. In the TOML I have several routes including the following for the static files that live-server will serve:

["/app/*"]
method = "all"
forward = "http://localhost:8080"

But live-server injects a little javascript so that if it sees that any of the files it serves have been changed on the disk it can notify the browser through a websocket that it needs to reload the page with the new content. However, as soon as I load my page I get the following error (rocky is on port 9000):

WebSocket connection to 'ws://localhost:9000/app//ws' failed: Connection closed before receiving a handshake response

live-server works fine if I hit it directly.

Back in the config file, I tried adding ws = true to the top of the file but then the routing seems to stop working. I get {"message":"Cannot set property 'options' of undefined"} when I hit the same url as before. I've tried variations of

["*/ws"]
ws = true
forward = "http://localhost:8080"

with routes like "/app//ws" and "/app/*/ws" but I still get the same socket connection failure. I've also tried adding ws = true to the "/app/*" route above but no dice.

Do I have a misunderstanding on how to specify the websocket proxy or is something else wrong?

@h2non
Copy link
Owner

h2non commented May 5, 2016

WebSocket traffic proxy is not supported via rocky-cli.
You can fork and add support for that directly at TOML level configuration. It should be simple to do.
Alternatively you can setup your proxy programmatically.

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

No branches or pull requests

2 participants