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

allow resource path to be set in connection URI #134

Merged

Conversation

joelnordell
Copy link
Contributor

This allows connection to a socket.io server that is using a path other than /socket.io/.

@j-zarzoso
Copy link

This is very useful. Some servers (like ours) don't use the default path and the library in its current state doesn't work with them,

@arximboldi
Copy link

Yes! This one should really be merged!

@arximboldi
Copy link

This fixes #191

@larrybahr
Copy link

Would be great if this could be merged!

@myzinsky
Copy link

Can this please be merged?

@darrachequesne darrachequesne merged commit 36a8cd4 into socketio:master Feb 14, 2021
@darrachequesne
Copy link
Member

@myzinsky done, sorry for the delay.

As I noted in the commit message, please note that this implementation differs from the JS one, where the resource path is the namespace you want to reach:

const socket = io("https://example.com/my-namespace", {
  path: "/my-custom-path/"
});

Here, we will have:

sio::client h;
h.connect("https://example.com/my-custom-path/");
h.socket("/my-namespace")->emit("hello");

druckdev added a commit to DeerSoftDevelopment/socket.io-client-cpp that referenced this pull request Apr 6, 2021
* upstream/master:
  docs: update compatibility table for Socket.IO v4
  docs: fix title format (socketio#297)
  feat: allow resource path to be set in connection URI (socketio#134)
  fix: resolve client_impl::ping LOG call syntax in debug builds
  fix: resolve socketio#254: handle closing sockets upon on_fail events
  fix: lower the minimum CMake supported version
  feat: implement socketio#45: add support for logging configuration
  feat: add support for Socket.IO v3
  refactor: use correct Engine.IO protocol revision
  refactor: use standard install paths (socketio#58)
  ci: migrate to GitHub Actions
  chore: update .gitignore with cmake output
  refactor: remove Boost dependency (socketio#176)
@you74674
Copy link

Can this be added to 2.x also?

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

Successfully merging this pull request may close these issues.

None yet

7 participants