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

Websockets and proxy #410

Closed
mburger81 opened this issue Mar 10, 2016 · 2 comments
Closed

Websockets and proxy #410

mburger81 opened this issue Mar 10, 2016 · 2 comments

Comments

@mburger81
Copy link

Hello,

I use for the devServer an proxy and it works great, anything which comes from /api/* will be redirect to my server.

proxy: {
        '/api/*': {
            target: 'http://192.168.1.1/abc/',
            secure: false,
        }
    }

so this
this.http.post('/api/v1/sensors'

will redirected to
http://192.168.1.1/abc/api/v1/sensors''

but how can I do the same thing for Websockets?
this.ws = new WebSocket('ws://api/v1/sensorsws');

thx
Michael

@jstri
Copy link

jstri commented Mar 10, 2016

webpack-dev-server v1 proxy implementation is based on https://github.com/nodejitsu/node-http-proxy library. Search for "Proxying WebSockets" (https://github.com/nodejitsu/node-http-proxy#proxying-websockets).

@PatrickJS
Copy link
Owner

@siready is correct. you can open another issue if you have any more problems with the repo thanks

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

No branches or pull requests

3 participants