You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If i use nginx as proxy,nginx's port is 80,react app's port is 3000,webpackHotdev create websocket with port 80,and the error occur.
What are you reporting?
Can't react-scripts support proxy?
Tell us what you think should happen.
webpack-dev-server\client\index.js
create html websocket client
var socketUrl = url.format({
protocol: protocol,
auth: urlParts.auth,
hostname: hostname,
port: (urlParts.port === '0') ? window.location.port : urlParts.port,
pathname: urlParts.path == null || urlParts.path === '/' ? "/sockjs-node" : urlParts.path
});
this port real value is 3000
webpackHotDevClient.js
nodejs create webscoket server!
var connection = new SockJS(url.format({
protocol: window.location.protocol,
hostname: window.location.hostname,
port: window.location.port,
// Hardcoded in WebpackDevServer
pathname: '/sockjs-node'
}));
this port real value is 80
So we can't communicate through websocket ,while we use a proxy server !
I think if we want to resolve this bug ,we should add a config to set websocket port and host!
The text was updated successfully, but these errors were encountered:
cyssxt
changed the title
If i use nginx as proxy,this port is 80,react app's port 3000,webpackHotdev
If i use nginx as proxy,this port is 80,react app's port 3000,webpackHotdev create websocket with port 80,and the error occur.
Jun 22, 2017
Description
If i use nginx as proxy,nginx's port is 80,react app's port is 3000,webpackHotdev create websocket with port 80,and the error occur.
What are you reporting?
Can't react-scripts support proxy?
Tell us what you think should happen.
webpack-dev-server\client\index.js
var socketUrl = url.format({
protocol: protocol,
auth: urlParts.auth,
hostname: hostname,
port: (urlParts.port === '0') ? window.location.port : urlParts.port,
pathname: urlParts.path == null || urlParts.path === '/' ? "/sockjs-node" : urlParts.path
});
this port real value is 3000
webpackHotDevClient.js
var connection = new SockJS(url.format({
protocol: window.location.protocol,
hostname: window.location.hostname,
port: window.location.port,
// Hardcoded in WebpackDevServer
pathname: '/sockjs-node'
}));
this port real value is 80
So we can't communicate through websocket ,while we use a proxy server !
I think if we want to resolve this bug ,we should add a config to set websocket port and host!
The text was updated successfully, but these errors were encountered: