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

Cannot use a custom path #95

Closed
kptdobe opened this issue Sep 14, 2017 · 5 comments
Closed

Cannot use a custom path #95

kptdobe opened this issue Sep 14, 2017 · 5 comments

Comments

@kptdobe
Copy link

kptdobe commented Sep 14, 2017

When setting a custom path via the options, the request always contains an extra trailing / in the path.

IO.Options options = new IO.Options();
options.path = "/bin/engine.io";
Socket socket = IO.socket(uri, options);

will lead to the following request

http://myserver/bin/engine.io/?=&EIO=3&transport=polling

which is not supported on my server.

This code explicitly adds the trailing /:

this.path = (opts.path != null ? opts.path : "/engine.io").replaceAll("/$", "") + "/";

Is there any specific reason for that ? Can we consider this as a bug ? I can do a PR, change is easy but impact might be huge.

@nkzawa
Copy link
Contributor

nkzawa commented Sep 14, 2017

The trailing / is deliberate since engine.io sever also normalizes the path like that.

https://github.com/socketio/engine.io/blob/master/lib/server.js#L449

I wonder why it doesn't work on your environment. What versions of client and server do you use?

@kptdobe
Copy link
Author

kptdobe commented Sep 14, 2017

I use the socket.io client

https://github.com/socketio/socket.io-client-java

which is based on your engine.
The server is our own made implementation of socket.io but the path is custom /bin/socket.io.

@nkzawa
Copy link
Contributor

nkzawa commented Sep 14, 2017

In that case, it'd be the easiest to fix your server since it's difficult to do this library.

@darrachequesne
Copy link
Member

Closed due to inactivity, please reopen if needed.

@IvanLotoff
Copy link

what was the problem to delete this / in one place. It really makes a lot of problems. What if a person doesnt have access to backend. This / is useless, if a user needs it he can add it without your checks

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

4 participants