{"id":37194403,"url":"https://github.com/barokurniawan/websocket","last_synced_at":"2026-01-14T22:36:05.356Z","repository":{"id":116533597,"uuid":"215236027","full_name":"barokurniawan/websocket","owner":"barokurniawan","description":"simple websocket implementation","archived":false,"fork":false,"pushed_at":"2020-08-08T23:48:39.000Z","size":129,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-19T04:27:04.808Z","etag":null,"topics":["golang","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barokurniawan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-10-15T07:34:46.000Z","updated_at":"2020-08-14T23:49:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"c478f576-c83e-42c0-8946-1636a6a35a0a","html_url":"https://github.com/barokurniawan/websocket","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/barokurniawan/websocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barokurniawan%2Fwebsocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barokurniawan%2Fwebsocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barokurniawan%2Fwebsocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barokurniawan%2Fwebsocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barokurniawan","download_url":"https://codeload.github.com/barokurniawan/websocket/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barokurniawan%2Fwebsocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","websocket"],"created_at":"2026-01-14T22:36:04.827Z","updated_at":"2026-01-14T22:36:05.348Z","avatar_url":"https://github.com/barokurniawan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# websocket\nSaya menggunakan service ini untuk melakukan update pada sebuah halaman berdasarkan interaksi dihalaman lain, ini lebih efisien dari pada menggunakan long polling ajax.\n\n## INSTALASI\n1. clone repository ini `git clone git@github.com:barokurniawan/websocket.git`\n2. install [go-dep](https://github.com/golang/dep)\n3. jalankan `dep ensure` untuk menginstall dependency\n\n## Menggunakan Docker \n- `docker-compose up --build`\n\n## RUN\n```\n\u003cscript type=\"text/javascript\"\u003e\n    const SOCKET_CHANNEL = \"PITSTOP_FIRST\";\n    window.customSocket = {};\n\n    window.customSocket.init = function () {\n        if (!(window.WebSocket)) {\n            console.log(\"Browser doesnot support websocket\");\n            return\n        }\n\n        window.customSocket = new WebSocket(\"ws://localhost:3001/socket?channel=\" + SOCKET_CHANNEL)\n\n        window.customSocket.onopen = function () {\n            console.log(\"Connect to websocket, send and receive on chanel \" + SOCKET_CHANNEL);\n        }\n\n        window.customSocket.onmessage = function (event) {\n            console.log(\"incoming...\");\n            console.log(event);\n        }\n\n        window.customSocket.onclose = function () {\n            console.log(\"Disconnected from websocket\");\n        }\n    }\n\n    window.customSocket.doSendMessage = function () {\n        window.customSocket.send(JSON.stringify({\n            Channel: SOCKET_CHANNEL,\n            Message: \"CHANGE\"\n        }));\n    }\n\n    window.onload = window.customSocket.init\n\u003c/script\u003e\n```\n\n```\nwindow.customSocket.send(JSON.stringify({\n    Channel: \"PITSTOP_FIRST\", // or MINE\n    Message: \"CHANGE\"\n}));\n```\n### Thanks\n[Noval Agung](https://github.com/novalagung/dasarpemrogramangolang) - tutorial web socket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarokurniawan%2Fwebsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarokurniawan%2Fwebsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarokurniawan%2Fwebsocket/lists"}