# go-websocket-sample **Repository Path**: mirrors_eliben/go-websocket-sample ## Basic Information - **Project Name**: go-websocket-sample - **Description**: Sample Go websocket server and JS client with tracing and JSON data interchange - **Primary Language**: Unknown - **License**: Unlicense - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-09-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Note - repository archived ========================== Contents moved to https://github.com/eliben/code-for-blog/tree/master/2016/go-websocket-sample go-websocket-sample =================== To see the sample in action, run: .. sourcecode:: text $ go run This starts up the server; it immediately reports which port it's listening on (the port can be changed with the ``-port`` flag). Then open a browser and visit ``http://localhost:`` to see the HTML page that talks with the server using websockets. The server also spins up a `net/trace `__ debugging page on ``/debug/requests``. What the sample does ==================== The JavaScript code powering the served web page records mouse movement events over the shown box and sends them to the server through a websocket. The server echoes the data back and this is used to update the text reporting the coordinates. Moreover, the server also periodically sends the current time over another websocket, which the client uses to update the time ticker at the top of the page. For more details just check out the source - it's very simple. License ======= This code is in the public domain. See the ``LICENSE`` file for more details.