Skip to content

Opening a connection with a query string #134

Open

Description

@zcoverstone

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?

Activity

  1. jcoglan commented on Jul 23, 2022

    @jcoglan
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions