trieulieuf9
trieulieuf9

Reputation: 55

How Reddit implements its Chat feature

I don't understand how Chat function in Reddit web application work.

When I send message to other user Through Chat function and open Developer tools > Network tab to see requests sent. I see a POST request to https://www.reddit.com/ with request body of 771 length. However, I cannot find my sent message here. If I send message with 10 characters, the POST request body will be 771 in length. If I send message with 100 characters, the POST request body will still be 771 in length.

So how is my message sent to server or to other user?

Upvotes: 0

Views: 50

Answers (1)

DownloadPizza
DownloadPizza

Reputation: 3466

As mentioned in my comment. Reddit uses websockets to send data back and forth. Unlike http, websockets are permanently open and can be used to send, but nore importantly receive data without reloading the site. They are however also good for sending as no new requests have to be made

Upvotes: 1

Related Questions