No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-12 21:00:31 +08:00
.gitignore Initial commit 2026-04-12 08:35:08 +00:00
go.mod implement a ws-to-syncplay line-protocol bridge 2026-04-12 21:00:31 +08:00
go.sum implement a ws-to-syncplay line-protocol bridge 2026-04-12 21:00:31 +08:00
LICENSE Initial commit 2026-04-12 08:35:08 +00:00
main.go implement a ws-to-syncplay line-protocol bridge 2026-04-12 21:00:31 +08:00
main_test.go implement a ws-to-syncplay line-protocol bridge 2026-04-12 21:00:31 +08:00
README.md implement a ws-to-syncplay line-protocol bridge 2026-04-12 21:00:31 +08:00

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