Omegle Protocol


Reading time: about 2 minutes

This page aims to describe the network protocol of Omegle. Omegle is a website and a mobile application that allows people to chat with random strangers. The network protocol is based on HTTP and JSON. It uses long-polling instead of websockets.

Choosing a server

Omegle has a few different servers. A client should pick a random one when connecting. The server address is http://frontX.omegle.com where X is a random number between 1 and 9.

Another way of picking a server is sending a GET request to http://omegle.com/status, parsing the JSON and picking a random server from servers.

Connecting to a server

Since the protocol is polling-based, state is maintained by getting a shard from the server when connecting and sending it back on every request. You can get this shard by sending a POST request to http://frontX.omegle.com/start with the data {"rcs": 1} and saving the shard you get in the response.

Disconnecting from the server

Disconnecting is really similar to connecting. Sending a POST request to http://frontX.omegle.com/disconnect with the data {"id": SHARD_GOES_HERE} is enough. To connect again, just get another shard by doing /start.

Sending a message

Sending messages is very important in a chat protocol. To send messages, you need to send a POST request to http://frontX.omegle.com/send with the data {"id": SHARD_GOES_HERE, "message": "Your message here!"}.

Getting events

In order to make a full chat client, you need to get events as well. These events include:

  • The other person connecting
  • The other person disconnecting
  • The other person typing a message
  • Receiving messages from the other person

To get the events, you need to send a POST request to http://frontX.omegle.com/events with the data {"id": SHARD_GOES_HERE}. In response, you will get a JSON list of events. The events are lists as well. The first member of the list is the event name and the of them are the arguments (such as the message from a message event).

Here are some of the events.

  • ["waiting"] Searching for a stranger
  • ["connected"] Found a stranger
  • ["strangerDisconnected"] The stranger disconnected
  • ["gotMessage", "Message text here"] The stranger sent a message
  • ["typing"] The stranger is typing
  • ["stoppedTyping"] The stranger stopped typing

Sending typing events

In order send the Stranger is typing notification to the other person, you can send a POST request to http://frontX.omegle.com/typing and http://frontX.omegle.com/stoppedtyping. Both of them need to have {"id": SHARD_GOES_HERE} in the post data.

Examples and more reading

Is Omegle peer-to-peer?

No, Omegle is not a peer-to-peer chat application. It communicates with a random server using JSON messages transferred over HTTP requests.

Is Omegle encrypted?

Omegle uses TLS when communicating with their servers. This means your network provider will be able to see that you are using Omegle, but not what you are typing. It is important to note that the messages are NOT end-to-end encrypted, which means Omegle is able to read everything you send and receive.

Citation

If you find this work useful, please cite it as:
@article{yaltirakli,
  title   = "Omegle Protocol",
  author  = "Yaltirakli, Gokberk",
  journal = "gkbrk.com",
  year    = "2024",
  url     = "https://www.gkbrk.com/omegle-protocol"
}
Not using BibTeX? Click here for more citation styles.
IEEE Citation
Gokberk Yaltirakli, "Omegle Protocol", October, 2024. [Online]. Available: https://www.gkbrk.com/omegle-protocol. [Accessed Oct. 10, 2024].
APA Style
Yaltirakli, G. (2024, October 10). Omegle Protocol. https://www.gkbrk.com/omegle-protocol
Bluebook Style
Gokberk Yaltirakli, Omegle Protocol, GKBRK.COM (Oct. 10, 2024), https://www.gkbrk.com/omegle-protocol

Comments

Comment by admin
2024-06-29 at 22:56
Spam probability: 3.921%

Consider yourself noticed @wulfey

Comment by Dox
2023-05-07 at 09:25
Spam probability: 1.83%

Nice, can I change my server?

Comment by wulfey
2022-12-01 at 22:34
Spam probability: 2.586%

heh, neat - wonder how long it'd take for someone to notice me here (psst!)

Comment by Cute
2022-11-24 at 10:17
Spam probability: 1.532%

Nice, can I change my server?

© 2024 Gokberk Yaltirakli