Skip to main content

Socket.IO

Socket.IO is a JavaScript library that facilitates real-time, bidirectional, and event-based communication between clients and servers. Built on top of WebSocket, it adds extra features for reliability, reconnection, and cross-browser compatibility, making it ideal for applications needing live updates and robust messaging.

Key Features of Socket.IO

  • Real-Time Communication: Enables immediate data exchange between client and server.
  • Event-Driven Architecture: Supports custom events (e.g., connect, disconnect, message) for structured, efficient communication.
  • Cross-Browser Compatibility: Works consistently across various platforms and browsers.
  • Namespaces and Rooms: Allows logical grouping of connections, which is helpful for private or group chats within applications.

SocketIO

8.1 Methods to Add Socket.IO

You can add a Socket.IO connection to your application through the following methods:

  1. From Main Screen
    • Access the main screen of the application.
    • Click the "Add Socket.IO" button for a quick setup.

SocketIO

  1. From the Left-Panel Section
    • Open the application.
    • Click the "+" icon on the left panel.
    • Choose "Add Socket.IO" from the dropdown.

SocketIO

  1. From the Collection Section
    • Open the application.
    • Click the "Collection/Folder" option in the left panel.
    • Click on the three dots and select "Add New Socket.IO."

SocketIO

  1. Using the Socket.IO Icon in the Collection Section
    • Access the left panel's "Collection" option.
    • Click on the Socket.IO icon to add a new connection.

SocketIO

8.2 How to Connect to Socket.IO

  • Enter Connection Details: Input the Socket.IO URL and events, headers, and parameters.
  • Connect: Click the "Connect" button after entering all the details.

SocketIO

  • Confirmation: A confirmation message will appear on the right side once the connection is successful.
  • Add message: Enter the required message and event name, and you will receive a response from Socket.IO accordingly.

8.3 Interacting with Socket.IO

  • Enter Message: Type your message in the designated format in the Message box.
  • Send: Click the "Send" button after composing your message.
  • View Response: Check the response on the right side of the screen and click to see detailed information.

SocketIO

  • Add Events: Use the toggle to add custom events like listen/unlisten for your request.

SocketIO

8.4 Using Response Format, Copy, and Download Options

  • Change Response Format: Click on the "Format" dropdown in the response details to change the view format.
  • Copy Response: Use the "Copy" icon to duplicate the response; a confirmation message will appear.
  • Download Response: Click the "Download" icon to save the response; choose your file location and confirm.

SocketIO

8.5 Using Search, Filter, Scroll, and Delete Functions

  • Search Messages: Enter your search term in the search box; the results update in real-time.

SocketIO

  • Filter Messages: Use the "Filter Message" dropdown to view "All," "Sent," or "Received" messages.

SocketIO

  • Scroll: Click the bottom or top arrows to navigate through the message history.
  • Delete Messages: Click the delete icon to clear messages, confirmed by a toast message.
  • Clear Input: Click "Clear Input" to reset the input field, with confirmation.

8.6 Saving Socket.IO for Future Use

  • Save Connection: After setting up, click "Save."
  • Select Collection: Choose or create a collection to store the Socket.IO connection.
  • Choose Folder: Similarly, choose or create a folder.
  • Edit Name and Description: Modify the default name or add a description if necessary.
  • Confirm Save: Click "Save" to store the connection for future use.

SocketIO