erikras / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using express, react, redux, webpack, and react-transform
MIT License
12k stars 2.5k forks source link

Websockets can't be disabled. #1114

Open OKNoah opened 8 years ago

OKNoah commented 8 years ago

It seems that setting

const proxy = httpProxy.createProxyServer({
  ws: false
});

in src/server.js does not disable the websockets. The app keeps trying to make API calls to localhost:3000/ws. Is another step necessary to prevent this?

roof12 commented 8 years ago

It looks like that is the code for proxying websocket requests. There is a block in src/client.js which should also be removed:

https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/client.js#L22

OKNoah commented 8 years ago

Maybe that code could be disables upon changing ws to false (or removing ws: true)?

roof12 commented 8 years ago

Are you suggesting a single switch that enables and disables WebSockets? That is a good idea, but I doubt it will happen.

This project has been an immense help to me and, it appears, many others. However, the developers don't seem be interested in moving it towards a general purpose framework. So just change the code or cut out what you don't use.

OKNoah commented 8 years ago

@roof12 OK, but the guide to disable websockets/API seems to imply this config variable does just that.