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

Replace express-ws with ws #206

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nacardin
Copy link

@nacardin nacardin commented Jul 9, 2021

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
Copy link
Owner

PepsRyuu commented Jul 9, 2021

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

@nacardin
Copy link
Author

nacardin commented Jul 9, 2021

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.

@@ -120,6 +116,10 @@ async function devServer(options) {
app.use(fallback(entryPoint, { root: options.contentBase }));
}

if (options.after) {
options.after(app, server);
Copy link
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
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