Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu faugere committed Jun 4, 2018
1 parent a98c3df commit 4ed9843
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +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: process.env.HOST || window.location.hostname,
port: process.env.PORT || window.location.port,
// Hardcoded in WebpackDevServer
pathname: '/sockjs-node',
pathname: '/sockjs-node'
})
);

Expand Down
6 changes: 6 additions & 0 deletions packages/react-scripts/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ 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 4ed9843

Please sign in to comment.