(with JSON-RPC example)
git clone [email protected]:bestpilotingalaxy/ws-chat.git
cd ws-chat
*change .env
if necessary
docker build -t ws-chat-server .
docker run --network host --env-file=.env ws-chat-server:latest
docker run --network host --env-file=.env -it --entrypoint /bin/bash solsson/websocat
From container shell:
websocat ws://0.0.0.0:$SERVER_PORT/ws
websocat --jsonrpc -b ws://0.0.0.0:$SERVER_PORT/ws
message format:
BroadcastToAll "hello"
(now only BroadcastToAll
method supported)
I'm personally use VSCode with dlv-dap debugger
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"debugAdapter": "dlv-dap",
"trace": "verbose",
"program": "${workspaceFolder}/cmd/server/",
"envFile": "${workspaceFolder}/.env"
}
]
}