File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,11 @@ if (module.hot && typeof module.hot.dispose === 'function') {
61
61
var connection = new SockJS (
62
62
url . format ( {
63
63
protocol : window . location . protocol ,
64
- hostname : window . location . hostname ,
65
- port : window . location . port ,
64
+ // hostname: window.location.hostname,
65
+ // port: window.location.port,
66
+ // https://github.com/facebook/create-react-app/pull/1588/commits/532b4636716b3006d848683131f96395e546fc1e
67
+ hostname : process . env . HOST || window . location . hostname ,
68
+ port : process . env . PORT || window . location . port ,
66
69
// Hardcoded in WebpackDevServer
67
70
pathname : '/sockjs-node' ,
68
71
} )
Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ function getClientEnvironment(publicUrl) {
85
85
// This should only be used as an escape hatch. Normally you would put
86
86
// images into the `src` and `import` them in code to get their paths.
87
87
PUBLIC_URL : publicUrl ,
88
+ // Useful for allowing the hot dev websocket to connect to the host
89
+ // specified in the env file, instead of window.location, which could
90
+ // be wrong if the dev server is being proxied.
91
+ 'HOST' : process . env . HOST || '' ,
92
+ 'PORT' : process . env . PORT || ''
88
93
}
89
94
) ;
90
95
// Stringify all values so we can feed into Webpack DefinePlugin
You can’t perform that action at this time.
0 commit comments