Skip to content
TORNLIFE More

New chat question

Started by xedx [2100735] on in Tools & Userscripts.

2 replies · 180 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 posts (100%) · the total is Torn's reply count + the opening post at the last fetch

Counted by TornLife from the archived posts.

Archived posts
3
Discussion span
→
People posting
2
Likes on archived posts
1
Authority score
34 / 100
Historical score
19 / 100
Story score
25 / 100
Engagement score
43 / 100
xedx [2100735]
Does anyone know if the new chat a) still uses WebSockets and b) if so, the new server address?

This is in regards to hooking chats, and re-directing to Discord.
xedx [2100735]
FWIW, anyone else looking, this is what I have found so far:

The URL I connect to with a WebSocket: wss://chat-dev.torn.com/socket.io/?userId=<my user ID>&EIO=4&transport=websocket

This URL came from one of Torn's script loaded from it's builds/sendbird-chat directory. Also what I see in WireShark - the IP address, anyways. Haven't decoded the TLS yet.

This connects, and stays connected (I send pings, receive pongs)

My '.onmessage' handler for the websocket receives messages, but not JSON encoded, rather just text that looks like:

[image: imgur.com]

So not quite to do with that. One prob may be I am directly using Node JS WebSockets; I haven't looked into the SendBird JS SDK much yet.

Edit: the string after the leading '0' (sometimes it's a '2' with no data following) can be treated as JSON, without parsing it. So you get an object with sid, upgrades, pingInterval, etc.