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

Opening a connection with a query string #134

Open
zcoverstone opened this issue Jul 23, 2022 · 1 comment
Open

Opening a connection with a query string #134

zcoverstone opened this issue Jul 23, 2022 · 1 comment

Comments

@zcoverstone
Copy link

I've previously been using Axios for a project, but I am looking to port it over to faye-websocket-ruby. The code I am looking to port doesn't seem to have an apparent equivalent that I can find for this project:

Here is an example

mysocket = io(CONNECT_STR, { path: "/xyz", transport: ['websocket'], query: {itemOne: 1, itemTwo: 2} });

Specifically, I am struggling with the path and query options; is there an equivalent to faye-websocket-ruby?

@jcoglan
Copy link
Collaborator

jcoglan commented Jul 23, 2022

This library does not have distinct options for constructing the connection URL, it expects to be given a complete URL and only parses it to the extent necessary to make the initial HTTP request. To make a client connection:

ws = Faye::WebSocket::Client.new('ws://example.com/xyz?itemOne=1&itemTwo=2')

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

2 participants