devServer websocket proxy cannot upgrade websocket connection
See original GitHub issueI’m submitting a bug report
webpack and webpack-dev-server version: webpack: 1.13.2 webpack-dev-server: 1.16.1
Please tell us about your environment: Linux Fedora 22
Current behavior: devServer websocket proxy cannot upgrade websocket connection sporadically
Expected/desired behavior: http-proxy-middleware should upgrade websocket requests always
Howto Reproduce / Setup
setup
devServer: {
proxy: {
'/hyperguard/websocket/*': {
target: 'ws://localhost:8082',
ws: true
}
}
}
http stream request
GET /hyperguard/websocket HTTP/1.1
Host: localhost:8079
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Sec-WebSocket-Version: 13
origin: http://localhost:8079
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: yrOcNHCvvVuGgttYgv9nzA==
Connection: keep-alive, Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
http stream response getting this response only sometimes, if not the websocket connection never be established
HTTP/1.1 101 Switching Protocols
upgrade: websocket
connection: Upgrade
sec-websocket-accept: I3u4B7iakSJWk4yLd02hfn+enus=
- that issue also occurs on different platforms (ubuntu 14.04, centos7)
- restarting webpack-dev-server doesnt change anything
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
websocket proxy cannot upgrade websocket connection #112
I figured out a way to reproduce a workaround with tornado + HPM + webpack-dev-server. If the problem occurs i just have to...
Read more >Proxy websockets connection within webpack-dev-server
I know how to proxy regular HTTP requests to another backend but it's not working for websockets, presumably because the target in the...
Read more >DevServer - webpack
This option allows specifying URL to web socket server (useful when you're proxying dev server and client script does not always know where...
Read more >webpack-dev-server - npm
Start using webpack-dev-server in your project by running `npm i ... --client-web-socket-url <value> Allows to specify URL to web socket ...
Read more >Server Options - Vite
Configure custom proxy rules for the dev server. ... If the Vite HMR client fails to connect WebSocket, the client will fall back...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

See the comment above me.
filed this bug on http-proxy-middleware chimurai/http-proxy-middleware#112