https://github.com/envek/go-websocket-webtransport-server
Dual WebSocket and WebTransport chat server in Go
https://github.com/envek/go-websocket-webtransport-server
golang websocket webtransport
Last synced: about 2 months ago
JSON representation
Dual WebSocket and WebTransport chat server in Go
- Host: GitHub
- URL: https://github.com/envek/go-websocket-webtransport-server
- Owner: Envek
- Created: 2023-07-07T13:29:55.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-07T13:31:07.000Z (almost 2 years ago)
- Last Synced: 2025-03-20T05:36:40.012Z (2 months ago)
- Topics: golang, websocket, webtransport
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```sh
go mod download
```2. Generate some local certificates with [mkcert](https://github.com/FiloSottile/mkcert)
```sh
mkcert -install
mkcert localhost 127.0.0.1 ::1
```## Run
```sh
go run .
```## Enjoy
### WebSocket
You can use [websocat](https://github.com/vi/websocat) for some chatting:
```sh
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!