You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With most other web technologies, context is used to add a prefix to everything relating to a certain library, this can be helpful for seperation of concerns as well as complying with reverse proxies, as well as generally being more portable.
Not only does the context in netty/socket.io not prefix everything (namespaces at the very least), but it changes the endpoint for the handshake.
I propose that we move the handshake endpoint setting into a new field (handshakePath, as an example), then change context to apply to everything in the library (including the new handshake path).
Example:
// Create the configConfigurationconfig = newConfiguration();
// Setting valuesconfig.setHostname("someHostname");
config.setPort(5001);
config.setContext("/api/socket");
config.setHanshake("/handshake");
// Creating the serverSocketIoServerserver = newSocketIoServer(config);
// Add the namespaceSocketIoNamespacenamespace = server.addNamespace("/chat");
The behavior should be as follows:
Handshake Url: http://someHostname:5001/api/socket/handshake
To join the chat mainspace: ws://someHostname:5001/api/socket/chat
A major benefit of this is if you ever decide to relocate your service, or put it behind a reverse proxy, you would only need to change the context path, the default value for the context path could be an empty string.
The text was updated successfully, but these errors were encountered:
This is kind of mentioned in #654 ,
With most other web technologies, context is used to add a prefix to everything relating to a certain library, this can be helpful for seperation of concerns as well as complying with reverse proxies, as well as generally being more portable.
Not only does the
context
in netty/socket.io not prefix everything (namespaces at the very least), but it changes the endpoint for the handshake.I propose that we move the handshake endpoint setting into a new field (handshakePath, as an example), then change context to apply to everything in the library (including the new handshake path).
Example:
The behavior should be as follows:
Handshake Url:
http://someHostname:5001/api/socket/handshake
To join the
chat
mainspace:ws://someHostname:5001/api/socket/chat
A major benefit of this is if you ever decide to relocate your service, or put it behind a reverse proxy, you would only need to change the context path, the default value for the context path could be an empty string.
The text was updated successfully, but these errors were encountered: