User Feedback - WebSocket support

Thank you.

When will it be possible to publish the WebSocket collections so that other people can fork?

Any progress? Thank you.

Hi
I use socket.io in postman with localhost

Now when I connect I can not emit anything to the client but if I send a message from postman it will be displayed.
What is the problem?

io.on("connection", (socket: Socket) => {
  socket.emit("message", "ok");
  io.emit("message", "ok1");
  socket.on("message", (b) => {
    console.log(b);
  });
});

I love this feature, and saving is amazing, but I do most of my work offline on secure networks. You just killed the most exciting feature postman has made in years by forcing online workspace to use it. PLEASE re-enable this in scratchpad mode or as another user suggested make a local workspace, even if it can never be synced. This was a lifesaver feature on my previous program and I was about to add it to this contract as well, but the more Postman kills the offline app the less likely it will be that I can get them to pay for it for full collaboration.

Hi all,

I face the same issue. Someone have a solution.
The connection works on raw but on socket.io failed

Please allow us to specify the options for the Socket.IO client. I’m mainly looking for a way to specify the auth token, but other options would also be nice.

const socket = io({
	auth: {
		token: "abc"
	}
});

I need set listeners before connecting, not after.

Hi @IBlasterus, welcome to the community!

You can add listeners and use the toggle to listen to them on connection. Please let us know if this works :slight_smile:

It’s works. Thanks. :slightly_smiling_face:

1 Like

Doesn’t work on a Mac. I normally have ^2 configured to switch to desktop 2, I disabled it and postman still doesn’t send the ‘null’.

I hav tried both ctrl-2 and shift-ctrl-2. and the C version \000. all to no avail…

Duplication Of Saved Websocket Requests

Hi team, exceptional tool! Has been an absolute blessing for my learning of REST APIs.

I am now creating a Chat service using Node.js and Socket IO. My current solution to run multiple client instances at once is to save a second instance and open that in a new tab. (Hopefully the below screenshot I took can be seen…)

Is there any functionality to duplicate these instances on the left and save them quickly? I.e. Duplicating “Client 1”. I have used a similar feature with standard HTTP REST API requests.

The ultimate problem is that when I want to create a new client to connect, I have to click new, Websocket Request, and copy over the connection URL and any events, headers or params I might have set (which can add up quick).

Another possible solution would be to use the save of “Client 1” as a template and open multiple tabs / client instances from that save blueprint, then I do not need to even save duplicates, just open a new tab from that save.

Send Predefined Messages to Server On Connect

I just wanted to split this into another reply to make it clearer.

Is there any functionality to automatically send predefined messages to the server when the client connects?

E.g. I click the connect button in Postman, client and server do the normal handshake, then on successful connection, client sends a predefined message that is attached to the saved Websocket Request blueprint which is of event type “join-room” and sends some JSON data. Perhaps I define this message in a tab next to the events tab. (I am working with Sockets.IO, hence the events tab, but the principle is the same)

1 Like

Well guess what all, I just discovered the “duplicate tab” feature, which pretty much answers my entire first question :slight_smile:

A follow up, and much less important question would be around the ability to rename these tabs? We are only able to rename the saved request which renames all tabs. This would be helpful for me to keep track of what sort of requests I might have sent in each tab. E.G. Tab 1 could be user “Foo” and tab 2 could be user “Bar”.

1 Like

I think in last update, websocket request can only be made when you are logged in to your postman account on desktop app. I think webscoket requests should be allowed in offline mode also. May be saving the websocket request and adding to collection can be a feature which requires logging in to your postman account. But please allow websocket requests without logging in.

Send a stomp message in text and then send another message with 00 in Binary Hexadecimal to end the stomp frame.
It works but it is a bit cumbersome.
image

Any updates on the progress of the feature list?

I’m particularly interested in:

  • [feature] Use the same cookies as in the HTTP requests. So I could, for example, log in a server via an HTTP auth request and then connect to the websocket in the same session. #24

Thanks!

When using Postman from Windows while having an application running within Windows Subsystem Linux 2 (WSL2 - Ubuntu 20.04 version), I cannot connect via WebSockets with the following error message:

" Error: connect ECONNREFUSED 127.0.0.1:3000"

Although, it seems to work via browser context, and I can use other requests for regular HTTP endpoints.

Please, feel free to check the attached screenshots. You can use the following repository to assert this matter:



If you think I should raise this matter with Microsoft, please let me know, and I will do it.

For reference,

I have raised this matter with Microsoft on github on the WSL repository since I found other people with similar issues.

1 Like

Could you please add Pre-request Script to WebSocket as well ?
“Pre-request Script” is very useful for testing Authorization, and I’m missing it on WebSocket.

Hey @vladimir-kouznetsov,
There’s a ticket on GitHub to enable scripting in WebSockets. Please upvote/add your comments there :slight_smile: