{"id":28916928,"url":"https://github.com/kimseogyoung/csharpchattingserver","last_synced_at":"2026-04-21T16:36:17.248Z","repository":{"id":299154989,"uuid":"1001978719","full_name":"Kimseogyoung/CSharpChattingServer","owner":"Kimseogyoung","description":"C# Socket/WebSocket ChattingServer + Redis PUB/SUB Example","archived":false,"fork":false,"pushed_at":"2025-06-15T05:55:56.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-15T06:28:47.143Z","etag":null,"topics":["csharp","redis","socket","websocket"],"latest_commit_sha":null,"homepage":"","language":"C#","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/Kimseogyoung.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,"zenodo":null}},"created_at":"2025-06-14T13:00:24.000Z","updated_at":"2025-06-15T05:55:59.000Z","dependencies_parsed_at":"2025-06-15T06:41:27.602Z","dependency_job_id":null,"html_url":"https://github.com/Kimseogyoung/CSharpChattingServer","commit_stats":null,"previous_names":["kimseogyoung/websocketchattingserver","kimseogyoung/csharpchattingserver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kimseogyoung/CSharpChattingServer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimseogyoung%2FCSharpChattingServer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimseogyoung%2FCSharpChattingServer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimseogyoung%2FCSharpChattingServer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimseogyoung%2FCSharpChattingServer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kimseogyoung","download_url":"https://codeload.github.com/Kimseogyoung/CSharpChattingServer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kimseogyoung%2FCSharpChattingServer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261212509,"owners_count":23125586,"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":["csharp","redis","socket","websocket"],"created_at":"2025-06-22T00:09:21.527Z","updated_at":"2026-04-21T16:36:17.219Z","avatar_url":"https://github.com/Kimseogyoung.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C# ChattingServer\n1. WebSocket\n2. Socket\n\n\n---\n## WebSocket\nC# ASP.Net 서버에서 WebSocket 기반 채팅 또는 알림 서비스를 구성함. \n\u003cbr\u003e멀티 인스턴스 환경에서 Redis Pub/Sub를 사용해 서버 간 메시지를 중계하는 구조\n\n```\n1. Server → Redis (Subscribe)\n2. Client → Server(WebSocket) → Redis (Publish)\n3. Redis → All Servers → Connected Clients\n```\n\n\n| 구성 요소         | 역할 |\n|------------------|------|\n| **Client**       | WebSocket을 통해 서버에 연결 |\n| **WebSocket Server** | Redis에 메시지를 `PUBLISH`, Redis 메시지를 `SUBSCRIBE` |\n| **Redis**        | 메시지 브로커 (Pub/Sub 시스템) |\n| **Redis 채널**   | `chat/room1`, `user/123` 등 주제 기반 메시지 구분 |\n\n\n실행\n![img1](Img/WebSocketHtmlTest.png)\n\u003cbr\u003e\nTODO: 멀티스레드 고려\n\n## Socket\nTODO: 구현중\n![img1](Img/20250629_SocketClientTest.png)\n\n## Redis PUB/SUB\n1. 구독중인 채널 보기\n```\nPUBSUB CHANNELS\n\n127.0.0.1:6379\u003e PUBSUB CHANNELS\n1) \"chat/world\"\n2) \"chat/guild\"\n```\n\n2. 채널에 연결된 Subscriber 수 보기\n```\nPUBSUB NUMSUB channel1 channel2 ...\n127.0.0.1:6379\u003e PUBSUB NUMSUB chat/world chat/guild\n1) \"chat/world\"\n2) (integer) 3\n3) \"chat/guild\"\n4) (integer) 1\n```\n\n3. 패턴 기반 구독\n```\nPSUBSCRIBE \u003cpattern\u003e\n```\n\n4. 메시지 발행\n```\nPUBLISH chat/world \"Hello subscribers!\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimseogyoung%2Fcsharpchattingserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimseogyoung%2Fcsharpchattingserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimseogyoung%2Fcsharpchattingserver/lists"}