{"id":18012866,"url":"https://github.com/simukti/dnswsforfun","last_synced_at":"2025-04-04T14:15:26.842Z","repository":{"id":141663311,"uuid":"531380418","full_name":"simukti/dnswsforfun","owner":"simukti","description":"A demo server that acts as a DNS proxy and HTTP server (including WebSocket server).","archived":false,"fork":false,"pushed_at":"2024-02-26T09:36:56.000Z","size":2556,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T23:49:07.504Z","etag":null,"topics":["channel","concurrent-programming","go","golang","goroutines","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simukti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-01T05:45:50.000Z","updated_at":"2023-07-17T14:34:32.000Z","dependencies_parsed_at":"2024-04-27T04:15:28.074Z","dependency_job_id":null,"html_url":"https://github.com/simukti/dnswsforfun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simukti%2Fdnswsforfun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simukti%2Fdnswsforfun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simukti%2Fdnswsforfun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simukti%2Fdnswsforfun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simukti","download_url":"https://codeload.github.com/simukti/dnswsforfun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247190253,"owners_count":20898702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["channel","concurrent-programming","go","golang","goroutines","websocket"],"created_at":"2024-10-30T03:19:21.033Z","updated_at":"2025-04-04T14:15:26.823Z","avatar_url":"https://github.com/simukti.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DNS And Websocket For Fun\n\nA toy server that acts as a DNS proxy and HTTP server (including WebSocket server).\n\n## Overview\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./dnsws.jpg\" alt=\"DNS And Websocket For Fun\"\u003e\n\u003c/p\u003e\n\n- DNS request log will be broadcasted to all connected WebSocket clients. To demonstrate server-initiated events.\n- It also receives an incoming free text message from the WebSocket client and the WebSocket hub will broadcast those\n  messages to all connected WebSocket clients. To demonstrate client-initiated events.\n- The internal mechanism for passing data between goroutine is using go-channel. \n- Implements [`share memory by communicating`](http://go-proverbs.github.io/).\n\n**_NOTE: this repository is a sample for the Golang sharing session showcase, mainly to cover WebSocket and concurrent\nprogramming (using goroutine and channel)._**\n\n## Build And Execute\n\n### Requirement\n\n- Go \u003e= v1.16\n\n### Build\n\nAll dependencies are included in `vendor` folder (`go mod tidy \u0026\u0026 go mod vendor`), so you can just clone this repo and\nthen:\n\n- `go build -trimpath -a -mod=vendor -tags \"osusergo,netgo\" -ldflags '-w -s -v' -o ./build/server ./main.go`\n\n### Execute\n\n- `./build/server`\n\nFor available arguments, use `./build/server -h`.\n\n## Demo\n\n- Open `http://127.0.0.1:8080` to see the web page, it will open new WebSocket session from the web browser.\n- Point your DNS resolver to `127.0.0.1` port `53` Or simple test using `dig` command, for example: `dig MX simukti.net @127.0.0.1`.\n\nTo simulate another WebSocket client connected, you can use one of these tools to connect to the WebSocket server at `ws://127.0.0.1:8080/ws`:\n\n- [WebSocket King Client (Chrome extension)](https://chrome.google.com/webstore/detail/websocket-king-client/cbcbkhdmedgianpaifchdaddpnmgnknn?hl=en)\n- [Weasel (Firefox extension)](https://addons.mozilla.org/en-US/firefox/addon/websocket-weasel/)\n- [Websocat CLI](https://github.com/vi/websocat)\n\n## LICENSE\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimukti%2Fdnswsforfun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimukti%2Fdnswsforfun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimukti%2Fdnswsforfun/lists"}