configurable hostname for sockjs-node
See original GitHub issuehttps://github.com/facebookincubator/create-react-app/blob/master/packages/react-dev-utils/webpackHotDevClient.js#L61-L69 as shown in this file there is no way to config hostname and everything about this sockjs-node ajax request. is there any reason for it that there is no configuration for it ?
I`m working on a product which is not spa. uses cookie sessions and there is no authentication token obviously. so I was in need of hot reload to. I load my react app inside the main app and for the hot reload I did change the source code of webpackHotDevClient to what I want in order to make /sockjs-node/info ajax works. without changing this config /sockjs-node/info hits http://app.dev/sockjs-node/info but I want it to hit on http://localhost:3000/sockjs-node/info.
var connection = new SockJS(
url.format({
protocol: "http",
hostname: "localhost",
port: "3000",
// Hardcoded in WebpackDevServer
pathname: '/sockjs-node',
})
);
after this change things are working fines with hot reload on
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:13 (1 by maintainers)
Top GitHub Comments
react-dev-utils
may be an internal package forcreate-react-app
but i highly recommend to make it configurable. I believe that many people would use this project for reference and make their own configs, just like me 😃I fixed this problem in this PR #1994 but it never got merged, there was a lot of discussion about a better solution but I was never entirely sure what the better solution was. Would love to get this fixed.