# go to frontend directory
cd src/frontend
# install packages
yarn
# parcel build
parcel build index.html
# after build frontend, you will have to run up http server
cd ../backend
go run main.go
Just go http://localhost:8080
Initialize the websocket
var ws = new Websocket("ws://example.com/ws")
The request is actually an HTTP request initially but we use ws://
or wss://
for secure connection
The server will then Upgrade
the connetion to a persistent two-way connection between the client and server
Websocket is not included as part of the Go standard library
$ go get github.com/gorilla/websocket