Skip to content

Commit

Permalink
commit reference from facebook#1588
Browse files Browse the repository at this point in the history
  • Loading branch information
ncruz committed Jul 22, 2019
1 parent 265c159 commit 3f922a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ if (module.hot && typeof module.hot.dispose === 'function') {
var connection = new SockJS(
url.format({
protocol: window.location.protocol,
hostname: window.location.hostname,
port: window.location.port,
// hostname: window.location.hostname,
// port: window.location.port,
hostname: process.env.HOST || window.location.hostname,
port: process.env.PORT || window.location.port,
// Hardcoded in WebpackDevServer
pathname: '/sockjs-node',
})
Expand Down
5 changes: 5 additions & 0 deletions packages/react-scripts/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ function getClientEnvironment(publicUrl) {
// This should only be used as an escape hatch. Normally you would put
// images into the `src` and `import` them in code to get their paths.
PUBLIC_URL: publicUrl,
// Useful for allowing the hot dev websocket to connect to the host
// specified in the env file, instead of window.location, which could
// be wrong if the dev server is being proxied.
'HOST': process.env.HOST || '',
'PORT': process.env.PORT || ''
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
Expand Down

0 comments on commit 3f922a3

Please sign in to comment.