Configuring socketIO request
In Firecamp, you can configure advance message requests to test the websocket API. You can test multiple live connections, headers, and query params.
Prerequisites#
Enter the server endpoint, emit and listen to the events.
In this article, you'll learn to use advanced features of SocketIO like,
- Multiple Connections
- Config
- Persistent Config
- Header
- Query param
- Auth
Navigate to the Connections tab below the URL bar.
1. Connections#
Establishing multiple connections#
Firecamp offers functionality where you can connect your socketio server with multiple virtual clients and connections. You can either send a message to one or all. Below is the direction to understand how to create multiple clients and configure headers and query params.
Bydefault the
Defaultconnection added.Direction#
Add new connection#
- Go to
Connectionsin the message playground. Click the+ New Connection - Add connection name.
- You can view all the current connections in the connection dropdown beside the
+ New connectionand from the URL bar beside thesavebutton.
Switching between connection#
- You can either change the connection from the connection dropdown or the URL bar in the middle dropdown before the save button.
Broadcasting events#
- Add the number of connections you'd like to send to message to. For example,
Adam,BobandLuciWhen you'll add the name, you can see at the response panel, all the added connection name tabs will appear. All the events sending to the particular connection will appear under the appropriate name. - Assume, you would like to send the message to
Bob.
- Goto
Emitterstab. - Select the
Bobfrom the connection dropdown before sending the button (green play icon) - Write the appropriate message and click the
Sendbutton.
- Navigate to the response panel and click the
Bobtab. You can view all the messages over here. Follow the same procedure to send the message to the rest of the connection.
2. Config#
- Click the
Configinside theConnectionstab. - In Firecamp you can find multiple options to configure WS connection. Following is the list of options with a specific purpose.
The
Configwill apply to the connections level only.
| # | Options | Description |
|---|---|---|
| 1. | Forcenew | Desc |
| 2. | Namespace | Desc |
| 3. | Path | Desc |
| 4. | Ping | Desc |
| 1. | Ping interval | Desc |
| 1. | Transports | Desc |
3.Persistent config#
Right below the config option, you can see the Persistent config, this is the request level configurations options.
| # | Options | Description |
|---|---|---|
| 1. | Reject unauthorized | Desc |
| 2. | Timeout | Desc |
| 3. | Reconnection | Desc |
| 4. | Reconnection attempts | Desc |
| 1. | Reconnection delay | Desc |
| 1. | Reconnection delay max | Desc |
3. Headers#
By default in Firecamp, there is Sec-WebSocket-Extensions, Sec-WebSocket-Protocol and Sec-WebSocket-Version
You add custom headers with Key and Value
4. Query params#
You can pass the query params in request by adding the value of Key and Value
5. Auth#
Auth is only supported the >= SocketIO v3
To pass the auth, please change your socketio version from the URL bar.
Now you can pass the auth in request by adding key and Value