Skip to content

Dual WebSocket and WebTransport chat server in Go

Notifications You must be signed in to change notification settings

Envek/go-websocket-webtransport-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dual WebSocket and WebTransport chat server in Go

Just for fun and learning.

Setup

  1. Get Go 1.18 (webtransport implementation doesn't compile on 1.19 or newer at the moment)

  2. Install dependencies

    go mod download
  3. Generate some local certificates with mkcert

    mkcert -install
    mkcert localhost 127.0.0.1 ::1

Run

go run .

Enjoy

WebSocket

You can use websocat for some chatting:

websocat --exit-on-eof ws://127.0.0.1:8090/chat

WebTransport

Open http://localhost:8090/ in a modern browser* and start chatting.

* Currently Chrome 97+, Firefox 114+, and Edge 98+ supports WebTransport. See https://caniuse.com/webtransport for the up to date list of supported browsers.

Or both!

Of course you can chat via both protocol at the same time!

About

Dual WebSocket and WebTransport chat server in Go

Topics

Resources

Stars

Watchers

Forks