Skip to content

Replace express-ws with ws#206

Draft
nacardin wants to merge 1 commit into
PepsRyuu:masterfrom
nacardin:websocket_proxy
Draft

Replace express-ws with ws#206
nacardin wants to merge 1 commit into
PepsRyuu:masterfrom
nacardin:websocket_proxy

Conversation

@nacardin

@nacardin nacardin commented Jul 9, 2021

Copy link
Copy Markdown

I need to proxy websocket connection to my backend. I was unable to use express-http-proxy or http-proxy along with express-ws. There was an error during the upgrade handshake. Handling the upgrade directly with ws fixes the issue. I also added the server object to the before and after since I needed it to handle the WS upgrade.

Thanks for reviewing!

@nacardin nacardin marked this pull request as draft July 9, 2021 19:43
@PepsRyuu

PepsRyuu commented Jul 9, 2021

Copy link
Copy Markdown
Owner

Looks good. I'll have a proper review as soon as I can! :)

@nacardin

nacardin commented Jul 9, 2021

Copy link
Copy Markdown
Author

I had forgotten about updating the tests, it might take me some time to do that, so not ready for review yet. I'll update when I can.

Comment thread lib/dev-server.js
}

if (options.after) {
options.after(app, server);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any particular reason for this to be moved below the fallback? This would be a breaking change, and it would probably cause the hook to not trigger at all if using historyApiFallback.

@PepsRyuu

Copy link
Copy Markdown
Owner

Went ahead with the removal of express-ws for ws in 0.18.0.

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

Successfully merging this pull request may close these issues.

2 participants