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

cf https://github.com/facebook/create-react-app/pull/1588 #1

Merged
merged 1 commit into from
Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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