-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sockjs-node ERR_CONNECTION_REFUSED when accessing from network #416
Comments
I have tried adding CORS headers to devServer to no avail: devServer: {
headers: {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
}
}, |
Change this line:
to
|
Thanks for pointing me in the right direction @sokra : I couldn't get this to work, possibly due to using a Mac locally and connecting via a windows machine which was not resolving the hostname correctly. However putting the IP in worked correctly: # https://www.npmjs.com/package/ip
npm install ip --save-dev
|
I have similar issue, but I get 404 instead of CONN refused. I am using dev middleware and hot middleware on express server to run the server. The page loads fine but the hot reload doesn't work. When I save a change , webpack rebuilds but doesn't automatically load the changes in the browser.
server.js :
Any ideas? |
I'm also getting the same error: I'm using: "express": "^4.14.0", "webpack": "^1.13.1", "webpack-hot-middleware": "^2.12.2", "webpack-middleware": "^1.5.1". Any help is appreciated. |
I also has some issues using
I expect using the IP as @mummybot suggested would work, but I just used
|
Just for future reference I was hitting 404 on this because I had: |
I'm also getting the same error: can you help me? |
For all people with the same error. It will also occur if your server (webpack-dev-sever) is listening on another port (e.g. 8080) than in line Change the webpack.config.js to
or change the port in the correspoding line: |
@gfried77 - Thanks! |
@gfried77 you're my hero |
since I am using |
@kaleemullah360 no you cant modify webpack.config.js. You can use: |
I have the same issue. We are developing using domain, not localhost. how can I change the host? |
@shtse8 I am not sure I understand your question correct. You could change localhost or 127.0.0.1 to 0.0.0.0 in the devServer object in your webpack config. Change the webpack.config.js to
and in the correspoding line: |
Thanks. I finally change it to |
I get this error if I try and do a get request on webpack dev server.
The above actually works fine, but then it sets off all the get requests to the sock-js that blow up my console. Is there a way to just disable this? I'm not using HMR. |
Turns out my issue was because I was running code on https and when I request something from webpack dev server it runs the socket code and uses whatever level of security is currently being used (in my case https). All I had to do was set https: true and it worked like a charm. |
I have webpack dev server running behind a proxy locally. In the proxy config file I am forwarding all requests with When WDS tries to listen to the sock-js socket for HMR it is requesting |
Hi, I have the same issue as well, I have tried everything that it says above, but still not luck. This is my webpack configuration. webpack.config.js
Any ideas? |
@appsparkler 's reply was very helpful.
It actually fixes both my problems: The issue I linked in the previous comment, where Electron tries to load |
Opened #2272 for this. |
In Ubuntu 18.04.03 Server Edition, I'm getting these error messages, when deploying my starting-page of webapp with vue.js: This is my vue.config.js file :
How to solve the problem? |
I am also having this problem, I've tried every combination of host name / configuration proposed above and still get this 403/404 error. I have a Django app serving the react app, maybe that's part of the problem. Looks something like this in the console.
There are other errors too but I imagine they stem from this. |
@appsparkler I put in vue.config. js:
But still get error message: GET https://localhost/sockjs-node/info?t=1580209837453 net::ERR_CONNECTION_REFUSED |
I put in webpack.config.js :
But I continue to get this error message: GET https://localhost/sockjs-node/info?t=1580209837453 net::ERR_CONNECTION_REFUSED Any idea about how to solve it? |
Should your GET not contain a port like 8443 or something? |
Hi @MarcoPortillo, It could be because of one of your browser-extensions. Can you try disabling all extensions and see if it works? Also; if possible, please provide a repo to replicate this error so that we can check on our system. Thanks :) |
@appsparkler In this issue report: webpack/webpack#10329 I described in detail the problem. |
@appsparkler thank you for your answers! I already solve the problem, I just update to a newer version and create the project from the beginning and the error is gone. |
@MarcoPortillo what did you update to a newer version? I'm still struggling with this problem
|
In the PC I installed ex-novo Ubuntu 18.04.3 Desktop and I verified that the problem disappeared. I ran the same tiny webapp in both laptop and pc, and using localhost and the ip-address both from within the laptop/PC and from the other device (PC/laptop) gave no error. According to you, what kind of problems/missing parts/lacking features or whatever the Ubuntu 18.04.4 Server Edition could have compared to the Ubuntu 18.04.4 Desktop Edition? |
You should reject create-react-app |
* Initial - migrated datasets page to updated API * dataset validation fix * account request migrations * account migrations * account updates * account fixes * Update dataManager.js * fixes for accounts * Update PoliciesCard.vue * settings * Fix for sockjs console errors webpack/webpack-dev-server#416 * get policy and policy accounts * Update DatasetsCard.vue * delete Policy * policy updates * fixes and console log reduction * b/152680662 * clean up Switched to using request header for the GcpAccount/createdBy attribute * clean up * clean up * clean up * b/152343675 - Admin init schema Init schema logic * re-factoring adding sync for policies * Update dataManager.js * Update AdminCard.vue * Update main.js * clean up * changing header * adding view function stubs * Updated related data upon dataset deletion b/152875220 b/152878707 * Update dataManager.js * migrating list views * updates for getView * view reference data * Migrating delete view * Migrating validation * view creation * Update EditView.vue * view creation migration * view creation and update fixes * Update bigqueryUtil.js * Update storageUtil.js * deploy updates * Update settings_cds-demo-2.json * Update settings_cds-demo-2.json * Update dataManager.js * Update settings.json * Delete validateManager.js This is a duplicate file that already exists https://github.com/GoogleCloudPlatform/cloud-datashare-toolkit/blob/cds-ui-v1/api/v1alpha/src/spots/validateManager.js * Update Dockerfile updating nginx version, name and date. * Update README.md Renamed BQDS to CDS and added the CDS API documentation link * Update deployment.yaml renamed BQDS to CDS * Update lb-service.yaml renamed BQDS to CDS * Update service.yaml renamed BQDS to CDS * Update index.html renamed BQDS to CDS * user * renaming bqds to CDS * removing unused firebase props * fix * moving runtime config * clean up * dataset fix * clean up * fixes * Update dataManager.js * Update dataManager.js * validation and test fixes * Update configValidator.js * Update configValidator.js * Update package-lock.json * alert for validation errors * b/153211376 * date fix * Update EditView.vue * Update settings.json * Update EditView.vue * renaming batch id * updated labelName to cfg.cdsManagedLabelKey * Re-factoring column/headers for sample data - Will re-use this for the custom policy SQL updates. * Update EditView.vue * Update EditView.vue * b/152209251 * Update EditView.vue * Update sqlBuilder.js * Update sqlBuilder.js * b/152209251 Adding PUT method for dataset * update dataset description / dataset link to bq console * Update index.js * git url updates * Update index.js * Update EditView.vue * removing colon * updated admin API endpoints, documentation, and frontend page for admin * bug fixes * Adding Authorization header * b/152209251 * firebase auth Co-authored-by: Christopher Page <chrispage@google.com>
What i get is a stream of ERR_CONNECTION_RESET errors in the console when debugging in Chrome (ie, hot reload not working). Now, my situation is that i'm running an ubuntu virtualbox guest, where the dev server is running, but trying to hit it from chrome running on the Windows host. Now certainly w/o doing anything else it won't work (since localhost:3035 is the windows host, not the ubuntu guest), but typically what you do is setup port forwarding. Eg, i fwd localhost:3000 on the windows box to the guest no problem. I did the same for 3035, w/o doing that i was getting ERR_CONNECTION_REFUSED, but now i get ERR_CONNECTION_RESET. Specifically, a curl on the ubuntu guest is fine:
But a curl on the windows host fails:
Somehow the dev-server is noticing "something" is amiss, but not sure how to fix it. EDIT:
to
in the webpacker.yml file (i'm using Rails/Vue), and that did the trick. No more ERR_CONNECTION_RESET errors. EDIT 2:
Yes, the double |
zone.js?6524:2526 GET https://localhost:9060/sockjs-node/info?t=1589222458358 net::ERR_CONNECTION_REFUSED |
This is my error what to do |
http://localhost:4200/sockjs-node/info?t=1589356081490 net::ERR_CONNECTION_REFUSED |
Add |
Changing |
where can i find the webpack to correct it? |
Hi all. I also ran into this problem using webpack-dev-server within a docker container. My problem was I had not published the 8080 port in the docker-compose file I used. I did EXPOSE the port in the Dockerfile so the HTTP requests worked fine, but the websocket connection needed for hot reload could not be established. Leaving this here for when someone runs into this problem using a docker (+ docker-compose) setup, especially when you can reach the server through HTTP, but WS gives errors: Make sure you correctly publish your ports! |
Specifying the host to localhost in the
|
- chrome://flags/#allow-insecure-localhost - webpack/webpack-dev-server#416 (comment)
I get the following errors filling up my console log when accessing from either a virtual machine or a remote computer's browser. Fortunately HMR still works correctly.
webpack.config.js
The text was updated successfully, but these errors were encountered: