# Is there a way I can use something like socket.io on the IC?

**URL:** <https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666>\
**Category:** Developers\
**Created:** [June 12, 2023, 7:17pm UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666 "2023-06-12T19:17:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 12, 2023, 7:17pm UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/1 "2023-06-12T19:17:32Z")

</div>

I want to have some real time communication system in my project, is there a way I can run a server for [socket.io](http://socket.io) in a cannister or some other way to use websockets on the IC? Thank you.

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [June 13, 2023, 7:12am UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/2 "2023-06-13T07:12:32Z")

</div>

[https://forum.dfinity.org/t/websockets-on-the-ic-psychedelicdao/14817](https://forum.dfinity.org/t/websockets-on-the-ic-psychedelicdao/14817)

---

<div class="post-metadata">

**Author:** ![peterparker](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@peterparker](https://forum.dfinity.org/u/peterparker)\
**Post date:** [June 13, 2023, 8:05am UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/3 "2023-06-13T08:05:13Z")

</div>

Here an answer to the same question from @rudi that is more up-to-date:

> [@WebSocket support](https://forum.dfinity.org/t/websocket-support/1869/17):
>
> Hi @lastmjs We wrapped up the proof-of-concept that was presented in the Public Global R&D. We are just waiting on the last approvals for open-sourcing it. I will let you know, when it is available.

---

<div class="post-metadata">

**Author:** ![rbirkner](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@rbirkner](https://forum.dfinity.org/u/rbirkner)\
**Post date:** [June 20, 2023, 11:26am UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/4 "2023-06-20T11:26:43Z")

</div>

Hi @iamenochchirima

we have just released our WebSockets proof-of-concept that showcases one way of enabling WebSockets and therefore “almost” real-time communication. You can find all the information in the following thread:

> [@WebSockets on the IC – A proof-of-concept](https://forum.dfinity.org/t/websockets-on-the-ic-a-proof-of-concept/20836):
>
> We are happy to share with you our WebSockets proof-of-concept, which demonstrates the potential of enabling WebSockets on the IC through a dedicated gateway. To facilitate WebSocket connections between frontends and canisters on the IC, we use a gateway. This gateway provides a standard WebSocket endpoint for frontends and handles the communication with the canister. It establishes WebSocket connections with canisters through update calls and uses polling to obtain the latest message…

---

<div class="post-metadata">

**Author:** ![iamenochchirima](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iamenochchirima/32/21673_2.png) [@iamenochchirima](https://forum.dfinity.org/u/iamenochchirima)\
**Post date:** [June 20, 2023, 11:36am UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/5 "2023-06-20T11:36:59Z")

</div>

Thank you for the update, studying it.

---

<div class="post-metadata">

**Author:** ![jdchibuk](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jdchibuk/32/13584_2.png) [@jdchibuk](https://forum.dfinity.org/u/jdchibuk)\
**Post date:** [November 30, 2023, 8:36pm UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/6 "2023-11-30T20:36:18Z")

</div>

Hi @rbirkner Did you try to run your implementation of the gateway socket on a hosted service?

We recently tried a web-socket implementation in javascript to speak to a canister for data transmission. We had success locally, however when trying to run on mainnet we ran into port issues.

Some of the port assignments we tried included port 80, 443/tcp and defined application ports 44389, 3001, we ran into issues with port 3000.

Do you know from your work if there was specific port assignments that needed to implemented to run on mainnet? Your help would greatly be appreciated.

---

<div class="post-metadata">

**Author:** ![tiago89](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/tiago89/32/22332_2.png) [@tiago89](https://forum.dfinity.org/u/tiago89)\
**Post date:** [November 30, 2023, 10:45pm UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/7 "2023-11-30T22:45:45Z")

</div>

Just tagging @ilbert ans @massimoalbarello as they are the ones maintaining web sockets nowadays.

---

<div class="post-metadata">

**Author:** ![massimoalbarello](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/massimoalbarello/32/6041_2.png) [@massimoalbarello](https://forum.dfinity.org/u/massimoalbarello)\
**Post date:** [December 1, 2023, 9:01am UTC](https://forum.dfinity.org/t/is-there-a-way-i-can-use-something-like-socket-io-on-the-ic/20666/8 "2023-12-01T09:01:18Z")

</div>

Hello @jdchibuk! @ilbert wrote a [tutorial](https://medium.com/@ilbert/websockets-on-the-ic-getting-started-5f8bcdfaabdc) explaining how to interact with the IC via WebSockets. I suggest you check it out and reach out to us on [Discord](https://discord.gg/ZJXzfkrcGa) if you have any questions.
