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

connection proxy #63

Closed
davidmoshal opened this issue Jan 26, 2016 · 5 comments
Closed

connection proxy #63

davidmoshal opened this issue Jan 26, 2016 · 5 comments

Comments

@davidmoshal
Copy link

davidmoshal commented Jan 26, 2016

Hi, just wondering if it's possible to piggyback Deepstream Client connections over the same port as the server, as is done with socket.io and engine.io.

i.e: instead of:
deepstream_client('localhost:6021')

I'd like to just use this on the client:
deepstream_client()

and have server-side middleware register on a known (configurable) path, e.g: /deepstream/, with the port being taken from the current url.

i.e: http communication with DS would piggy-back on the same port.

That way I can be sure that corporate customers can just use one port to connect to the backend?

Dave

@WolframHempel
Copy link
Member

Hi @davidmoshal ,

thanks for raising this. You're making a very good point (in fact a related issue has come up before). For the next release of deepstream.io I'd propose adding support for the following two server options

/**
* An instance of a Node HTTP server object. Allows to use
* deepstream from within Node HTTP server implementations, 
* e.g. ExpressJS
*
* @type http.Server
* @default null
*/
server.set( 'httpServer', myHttpServer );

/**
* A subpath for browser clients to connect to. Corresponds
* to the client's path option
*
* @type String
* @default '/engine.io'
*/
server.set( 'urlPath', '/ds-connections' );

Please let me know if that would satisfy your requirements.

@davidmoshal
Copy link
Author

I'm fine with any config option, as long as I can piggyback one port.
Given that you are using engine.io this should be trivial to implement, no?

https://github.com/socketio/engine.io

@inxilpro
Copy link

See deepstreamIO/deepstream.io#92

@yasserf
Copy link
Contributor

yasserf commented Feb 18, 2016

We should test this and see if it just works out of the box now that deepstreamIO/deepstream.io#92 is implemented

@yasserf yasserf added the ready label Apr 29, 2016
@yasserf
Copy link
Contributor

yasserf commented Apr 29, 2016

Connection defaults to /engine.io path on same host and port as current url

@yasserf yasserf closed this as completed Apr 29, 2016
@yasserf yasserf removed the ready label Apr 29, 2016
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