Skip to content
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

React App using socket.io client tries to make a connection to http://127.0.0.1:50005/socket.io/?EIO=3&transport=polling&t=MLY0Fkf, but I am using a remote socket server + enforcing websocket transport #1228

Closed
1 of 2 tasks
acoutts opened this issue Aug 22, 2018 · 7 comments

Comments

@acoutts
Copy link

acoutts commented Aug 22, 2018

You want to:

  • report a bug
  • request a feature

Current behaviour

Users are seeing this error in their browser, as well as myself on my local environment:
screen shot 2018-08-22 at 10 22 58 am

Steps to reproduce (if the current behaviour is a bug)

const io = require('socket.io-client')
var socket_url = `http://[REMOTE_WEBSOCKET_HOST]`; //~ TODO: move this somewhere else

var socket = io(socket_url, {transports: ['websocket']});

Note that the socket server is remote but socket.io is still trying to open a localhost connection on every end user browser.

Expected behaviour

It should not attempt to connect to this localhost socket.
Note: socket.io is working as expected otherwise, this is just an error that users are reporting they are seeing.

Setup

  • OS: macOS High Sierra 10.13.6
  • browser: Google Chrome Version 68.0.3440.106 (Official Build) (64-bit)
  • socket.io version: socket.io-client 2.1.1

Other information (e.g. stacktraces, related issues, suggestions how to fix)

polling-xhr.js:263 GET http://127.0.0.1:50005/socket.io/?EIO=3&transport=polling&t=MLY0Fkf 0 ()
./node_modules/engine.io-client/lib/transports/polling-xhr.js.Request.create @ polling-xhr.js:263
Request @ polling-xhr.js:165
./node_modules/engine.io-client/lib/transports/polling-xhr.js.XHR.request @ polling-xhr.js:92
./node_modules/engine.io-client/lib/transports/polling-xhr.js.XHR.doPoll @ polling-xhr.js:122
./node_modules/engine.io-client/lib/transports/polling.js.Polling.poll @ polling.js:118
./node_modules/engine.io-client/lib/transports/polling.js.Polling.doOpen @ polling.js:63
./node_modules/engine.io-client/lib/transport.js.Transport.open @ transport.js:80
./node_modules/engine.io-client/lib/socket.js.Socket.open @ socket.js:245
Socket @ socket.js:119
Socket @ socket.js:28
./node_modules/socket.io-client/lib/manager.js.Manager.open.Manager.connect @ manager.js:226
Manager @ manager.js:69
Manager @ manager.js:37
lookup @ index.js:60
Promise.race.Promise @ scatter.esm.js:128
link @ scatter.esm.js:127
resolve @ scatter.esm.js:569
connect @ scatter.esm.js:553
_callee5$ @ ScatterStore.js:379
tryCatch @ runtime.js:62
invoke @ runtime.js:296
prototype.(anonymous function) @ runtime.js:114
step @ OrderEntryStore.js:106
(anonymous) @ OrderEntryStore.js:106
(anonymous) @ OrderEntryStore.js:106
ScatterStore @ ScatterStore.js:432
./src/stores/index.js @ index.js:23
__webpack_require__ @ bootstrap d1fd0316e478a1070bc5:678
fn @ bootstrap d1fd0316e478a1070bc5:88
./src/index.js @ index.css?f255:26
__webpack_require__ @ bootstrap d1fd0316e478a1070bc5:678
fn @ bootstrap d1fd0316e478a1070bc5:88
0 @ index.js:27
__webpack_require__ @ bootstrap d1fd0316e478a1070bc5:678
(anonymous) @ bootstrap d1fd0316e478a1070bc5:724
(anonymous) @ bootstrap d1fd0316e478a1070bc5:724
10:19:17.353 
@darrachequesne
Copy link
Member

What is the value of socket_url̀? Could it be undefined or something like that?

@acoutts
Copy link
Author

acoutts commented Aug 22, 2018

Thanks @darrachequesne - it is indeed defined there, I just removed it for a placeholder before posting this.

@acoutts
Copy link
Author

acoutts commented Aug 22, 2018

Closing as this appears to be an issue in the scatter-js package.

@acoutts acoutts closed this as completed Aug 22, 2018
@yogeshR5
Copy link

yogeshR5 commented Nov 22, 2018

@acoutts
Same error while running on a socket

The Error 👍
POST http://localhost:3000/socket.io/?EIO=3&transport=polling&t=MSwHsDu 404 (Not Found)

@anshulshacks
Copy link

Was anyone able to figure out what fixed their error. I have the same error:
Screen Shot 2020-08-22 at 2 24 08 PM

@darrachequesne
Copy link
Member

@anshulshacks could you please provide a way to reproduce, and create a new issue with all necessary details? Thanks!

@Flaminiat
Copy link

any news on the fix for this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants