Skip to content

devServer websocket proxy cannot upgrade websocket connection #620

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

Closed
desytech opened this issue Sep 22, 2016 · 5 comments
Closed

devServer websocket proxy cannot upgrade websocket connection #620

desytech opened this issue Sep 22, 2016 · 5 comments

Comments

@desytech
Copy link

desytech commented Sep 22, 2016

I'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
@SpaceK33z
Copy link
Member

Could you file this bug on http-proxy-middleware? I think this is out of hands for us.

@desytech
Copy link
Author

filed this bug on http-proxy-middleware chimurai/http-proxy-middleware#112

@SpaceK33z
Copy link
Member

I'm closing this issue because it is an upstream bug that we have no control over.

@tylercollier
Copy link

@SpaceK33z Would you please link to the upstream bug so readers can know where to look for any type of support or workarounds?

@SpaceK33z
Copy link
Member

See the comment above me.

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

No branches or pull requests

3 participants