{"id":27192337,"url":"https://github.com/sameh-farouk/go_resp_server","last_synced_at":"2025-04-09T18:44:34.346Z","repository":{"id":149095313,"uuid":"621301557","full_name":"sameh-farouk/go_resp_server","owner":"sameh-farouk","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-11T01:40:08.000Z","size":3101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T22:24:22.417Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sameh-farouk.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":"2023-03-30T11:47:18.000Z","updated_at":"2023-04-10T12:34:29.000Z","dependencies_parsed_at":"2024-06-20T21:36:02.496Z","dependency_job_id":"73f1b4a3-bda8-49ef-a1ee-51766cbb4d48","html_url":"https://github.com/sameh-farouk/go_resp_server","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/sameh-farouk%2Fgo_resp_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2Fgo_resp_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2Fgo_resp_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sameh-farouk%2Fgo_resp_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sameh-farouk","download_url":"https://codeload.github.com/sameh-farouk/go_resp_server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248090838,"owners_count":21046155,"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":[],"created_at":"2025-04-09T18:44:33.746Z","updated_at":"2025-04-09T18:44:34.330Z","avatar_url":"https://github.com/sameh-farouk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GO_RESP_SERVER\n[RESP](https://redis.io/docs/reference/protocol-spec/) server with two custom commands.\n\nThis is a learning by doing project, built in few hours while reading how resp protocol works.\n\nDisclaimer:\nDon't use this in production.\n\n ## Compile \u0026 Run Server\nrun the command below to compile the server:\n\n```bash\ngo build ./cmd/server/\n```\n\nNext, run the server as:\n\n```bash\n./server\n```\n\nThe above command should run the TCP server and we can make tcp connections to it.\n\n## Testing the TCP Server\nThe server include handlers for two custom commands, `HI` and `TESTURL`.\n\nTo test the resp server, you can use redis-cli using the command:\n\n```bash\nredis-cli -p 3333\n```\n\nTry `HI` command, the server should respond with a Hi back\n\n```bash\n\"Hi back!\"\"\n```\n\nalso you can use `TESTURL` command to check if url is reachable.\nit should response with 1 if the url is reachable, otherwise 0:\n\n```bash\nredis-cli -p 3333\n127.0.0.1:3333\u003e TESTURL threefold.io\n(integer) 1\n127.0.0.1:3333\u003e TESTURL gle.co\n(integer) 0\n```\n\nif redis-cli not available, you can use netcat\n\n```bash\n{ echo -e '*1\\r\\n$2\\r\\nHI\\r\\n'; sleep 1; } | netcat localhost 3333\n```\n\noutput\n\n```bash\n$8\nHi back!\n```\n\n{ echo -e '*2\\r\\n$7\\r\\nTESTURL\\r\\n$5\\r\\ng.com'; sleep 3; } | netcat localhost 3333\n\noutput\n\n```bash\n:0\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameh-farouk%2Fgo_resp_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsameh-farouk%2Fgo_resp_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsameh-farouk%2Fgo_resp_server/lists"}