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

Websocket connection not going through? #96

@coreyog

Description

@coreyog

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions