netty-socketio-demo icon indicating copy to clipboard operation
netty-socketio-demo copied to clipboard

socketio-demo Not remotely access

Open penweizgx opened this issue 10 years ago • 4 comments

var chat1Socket = io.connect('http://localhost:9092/chat1'); //yes var chat1Socket = io.connect('http://192.168.1.105:9092/chat1'); //error How to solve this CORS problem?

penweizgx avatar Oct 23 '14 05:10 penweizgx

via Configuration.setOrigin("*")

mrniko avatar Nov 10 '14 13:11 mrniko

Dear mrniko, first of all, thank you for your amazing works.

I am trying to access the server remotely, but im clueless about how to code the server. I have the following:

  _config.setOrigin(" * ");_
  _config.setHostname("ip address");_
  _config.setPort(3333);_

for client, i have var chat1Socket = io.connect('http://ip address: 3333);

but it doesnt work, i just want to know where to set the domain and hostname. The question may be stupid but I am kinda new to the server thing. Thank you in advance.

kevinwang413382 avatar Dec 24 '15 20:12 kevinwang413382

Hi! setOrigin(" * ") - remove spaces.

mrniko avatar Dec 25 '15 09:12 mrniko

i leave the space to make it obvious for you to see. So in my project I do not leave any spaces. Sorry for the confusion

kevinwang413382 avatar Dec 25 '15 12:12 kevinwang413382