No description
- Go 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitignore | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| main_test.go | ||
| README.md | ||
syncplay-bridge
syncplay-bridge bridges WebSocket and Syncplay TCP in both directions.
WebSocket
When a client connects to WebSocket, the bridge dials one TCP connection to the upstream Syncplay server.
WebSocket text messages are normalized to Syncplay line protocol by appending \r\n when missing, then forwarded to TCP.
TCP data is buffered until \r\n, then each complete line is forwarded to WebSocket as a text message without the trailing \r\n.
If either side disconnects, the bridge closes the other side too.
The bridge logs both directions and lifecycle events.
Run
go run . --listen :8080 --path /ws --syncplay 127.0.0.1:8999
Flags
--listen: HTTP listen address.--path: WebSocket endpoint path.--syncplay: upstream Syncplay TCP address. Default:127.0.0.1:8999.--dial-timeout: timeout for the upstream TCP connection.
Example:
go run . --listen :8080 --path /ws --syncplay 127.0.0.1:8999 --dial-timeout 5s