consider: pathname support #146

Closed
matthewmueller opened this Issue Mar 24, 2013 · 2 comments

Projects

None yet

2 participants

@matthewmueller

Right now engine.io ignores the pathname (/users) when I do this:

var socket = new EngineIO('localhost:8080/users')

Maybe this is for higher-level abstractions, but having access to the pathname is nice for room/group messages.

I was able to get it working by converting pathname into a querystring ie. localhost:8080/news/today => localhost:8080/?pathname=/news/today but I wonder if this is something that could easily be supported in engine.io.

@matthewmueller matthewmueller referenced this issue in socketio/engine.io Mar 24, 2013
Closed

consider: pathname support #163

@matthewmueller

So looking at the code a bit closer, it looks like you can set the path as an option:

this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';

Which, by default has an endpoint that looks like: http://localhost:9000/engine.io/?EIO=2&transport=polling

I guess what I'm looking for is a way to pass your current URL, window.location.pathname, (ie. /users) to the server-side. This would allow for channels/groups to be based on the current URL you are at. Similar to how: https://github.com/adlawson/wesley does pooling.

@rauchg

The path should be passed down from the URI though if you pass a string, maybe we missed that

@rauchg rauchg closed this Jan 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment