0

I am trying to replicate the example simple_chat in the gevent-socketio module gevent-socketio, simple_chat example.

Every thing goes as it should when in chat.html the connection io is set to:

// socket.io specific code
var socket = io.connect("http://localhost:8080");

i.e, when I make the connection in my own computer to my own computer.

The problem comes when i upload this example to a web site and I point to the address of my computer in this way:

var socket = io.connect("http://11.22.33.44:8080");

where 11.22.33.44 is the address of my computer (public address). Doing this makes that chat.html is not displayed correctly and in the javascript console this is pointed out:

http://11.22.33.44:8080/socket.io/1/?t=1422551801251 net::ERR_CONNECTION_REFUSED

(file 'chat.py' is running in my computer as in the previous case). For sure I am missing something important here. Any advice?

Miguel Vazq
  • 1,459
  • 2
  • 15
  • 21
  • How do you open `chat.html`? Like a file (`file:///some/path/chat.html`) or a page (`http://11.22.33.44/chat.html`)? Looks like a CORS error to me. – twil Jan 29 '15 at 18:03
  • Hi twil, the file chat.html is in a web server like `http://www.whatever.com`. So the code in that file is pointing to 11.22.33.44 which is the address that MY COMPUTER has. So chat.html is a "remote" client, sending to and receiving form my computer/python-server, that saw from the web, has address 11.22.33.44. Hope this helps to clarify. – Miguel Vazq Jan 29 '15 at 20:14
  • So `chat.html` and `chat.py` are on different domains, aren't they? If they are then check `Access-Control-Allow-Origin` header and wikipedia http://en.wikipedia.org/wiki/Cross-origin_resource_sharing – twil Jan 29 '15 at 23:42

0 Answers0