Webpack-dev-server: devServer websocket proxy cannot upgrade websocket connection

Created on 22 Sep 2016  路  5Comments  路  Source: webpack/webpack-dev-server

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
bug refactor

All 5 comments

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

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

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

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

See the comment above me.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eyakcn picture eyakcn  路  3Comments

hnqlvs picture hnqlvs  路  3Comments

gimmi picture gimmi  路  3Comments

subblue picture subblue  路  3Comments

antoinerousseau picture antoinerousseau  路  3Comments