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

Does iocat consider sub urls ? #4

Open
nelson777 opened this issue Aug 1, 2017 · 3 comments · May be fixed by #6
Open

Does iocat consider sub urls ? #4

nelson777 opened this issue Aug 1, 2017 · 3 comments · May be fixed by #6

Comments

@nelson777
Copy link

I'm trying to configure an Apache proxy to a websocket. The websocket is working ok and I access it normally with

iocat --socketio ws://localhost:12345 -e test

I want this socket to be availabe through https://localhost/prj/socket url. But when I configure Apache proxy, I'm not sure iocat considers the suburl part. I mean, in this command:

iocat --socketio https://localhost/prj/socket -e teste

is the /prj/socket part considered (send to the server) ? if not, how do I use suburls ?

@moul
Copy link
Owner

moul commented Aug 4, 2017

Hi @nelson777,

This CLI tool passes your URL argument to the io.connect() function https://github.com/socketio/socket.io-client, I'm not 100% sure, but I think that this library handles correctly the subpaths; is it possible for you to give a test in another environment?

@nelson777
Copy link
Author

nelson777 commented Aug 4, 2017

In order for it to work, this:

iocat --socketio https://localhost/prj/socket -e test

should translate to this:

var socket = io.connect('https://localhost', {path: '/prjsocket/socket.io'});

if the call is made this way:

var socket = io.connect('https://localhost/prjsocket/socket.io'); // broken

it won't work. I checked your code but where unable to find this part. Can you tell me which case is it ?

moul added a commit that referenced this issue Oct 13, 2017
@moul moul linked a pull request Oct 13, 2017 that will close this issue
@moul
Copy link
Owner

moul commented Oct 13, 2017

Hi @nelson777, can you give a try to #6?

@helpr helpr bot added the pr-available label Jul 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants