IC WebSocket: Beta Release

Hello everyone,

@ilbert and I are continuing the work originally started by Dfinity to provide WebSocket functionality to the canisters deployed on the Internet Computer.

Today, we are releasing a beta version comprising:

A demo is live on mainnet and it’s using a WS Gateway hosted by us to create a full-duplex connection between the frontend (integrating the SDK) and the backend (integrating the CDK).

We wrote a tutorial which will show you how to get started using WebSockets in your canister dApp in just 10 minutes.

DISCLAIMER: this is a beta version and should not be used in production. Breaking changes are to be expected. Please refer to our roadmap to know when IC WebSocket will be ready for production use.

ASK: we would love your feedback on this early version so that we can iterate and deliver what the community wants. If you follow our tutorial, please get in touch with us to let us know how we can improve.

We hope many of you will spend this first weekend of August exploring the possibilities of interacting with the Internet Computer via WebSocket :slight_smile:

Let’s fucking build!

26 Likes

Wow that’s awesome. How was this possible?

1 Like

The Gateway does the magic.

It exposes a WebSocket endpoint to (frontend) clients and polls the canisters on the other side.
This way, when from the canister you call ws_send, your message is saved in the canister’s state and read from the Gateway in the next polling iteration.
When the Gateway reads the message, it sends it through WebSocket over to the client.

If you want to go deeper, have a look at the How it works section of the Gateway’s README and feel free to ask any other questions here :wink:

6 Likes

You and @ilbert are definitely on my #icp-awesome list for doing this :grinning:

6 Likes

It was great to brainstorm with you guys on the call a few days ago. Congratulations on the beta release. Looking forward to exploring an implementation where we can run the gateway on boundary nodes and enable low-latency communication on Internet Computer infrastructure. This improvement will be crucial to building fully on-chain games on ICP, and it will be deeply integrated into BOOM DAO’s infrastructure. Thanks for the awesome work!

8 Likes

Thanks for releasing! One of my first responses is thinking about this could help enable multiplayer pooling. Definitely exciting!

4 Likes

nice job.can not wait

2 Likes

We have early version of IC4J Java Websockets Client communicating with WS gateway. Enables any Java or Kotlin application to receive WS messages from ICP. Finishing some exception handling and we will publish it on Github soon.

5 Likes

Published an early version of IC4J Websocket Client.

This Java library implements the #ICP Websocket Gateway protocol, allowing any Java application to receive Websocket messages from ICP smart contracts.

12 Likes

The stable release of IC WebSocket is out!

5 Likes