Me on Shibuya crossing in Tokyo while I was working on my startup Mangaido.com

Very simple js p2p serverless chat on WebRTC

Michal Wrzosek
1 min readNov 3, 2019

I recently wanted to check if it’s possible to create a simple js chat with no servers in-between, so that you can directly talk with someone else via secure channel.

I found that some browsers support WebRTC. It wasn’t clear for me at the beginning how to deal with it but eventually I was able to establish p2p connection with my friends in different networks. There is still a need for STUN/TURN servers to establish connection but as far as I know it’s secure.

Currently demo chat works in Firefox. I had some issues with STUN servers in Chrome. I will gradually work on improving that thing. I encourage you to try out your own builds on WebRTC :)

The idea is that HOST get a connection code. HOST send to SLAVE his code somehow (through some other chat for example). Once the HOST paste code from SLAVE, p2p connection starts and they can talk, wow :D

You can find out source code and demo app here:
https://github.com/michal-wrzosek/p2p-chat

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Michal Wrzosek
Michal Wrzosek

Written by Michal Wrzosek

Senior Software Engineer currently on contract assignment @ Shell in Rotterdam, Netherlands

No responses yet

Write a response