{"id":17992022,"url":"https://github.com/coin8086/winsocket","last_synced_at":"2025-03-26T00:31:11.129Z","repository":{"id":40992392,"uuid":"274660415","full_name":"coin8086/WinSocket","owner":"coin8086","description":"TLS Examples in Schannel and IO Completion Ports","archived":false,"fork":false,"pushed_at":"2022-06-21T14:38:49.000Z","size":105,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T23:06:04.042Z","etag":null,"topics":["iocp","samples","schannel","socket","tls","windows"],"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/coin8086.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}},"created_at":"2020-06-24T12:14:27.000Z","updated_at":"2025-02-15T22:01:54.000Z","dependencies_parsed_at":"2022-09-18T14:31:44.238Z","dependency_job_id":null,"html_url":"https://github.com/coin8086/WinSocket","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/coin8086%2FWinSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coin8086%2FWinSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coin8086%2FWinSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coin8086%2FWinSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coin8086","download_url":"https://codeload.github.com/coin8086/WinSocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245566090,"owners_count":20636390,"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":["iocp","samples","schannel","socket","tls","windows"],"created_at":"2024-10-29T19:26:42.083Z","updated_at":"2025-03-26T00:31:10.842Z","avatar_url":"https://github.com/coin8086.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TLS Examples in Schannel and IO Completion Ports\n\n## Before You Run\nYou need a certificate for the server. The Subject Name of the certificate must be \"localhost\", and the certificate must be stored in the \"My\" store of the system's certificate store, in the \"Local Machine\". The certificate can be self issued but must not be expired.\n\n## Simple Server and Client\nStart echo server and write what received to stdout, which is redirected to file `svr-output` since client may send binary data.\n\n```\nSimpleSocketServer.exe -t 1\u003esvr-output\n```\n\nStart client to send `file-to-send` to server, and write what server sent back to stdout, which is redirected to file `cli-output`.\n\n```\nSimpleSocketClient.exe localhost -t 1\u003ecli-output \u003cfile-to-send\n```\n\nIn the end, `svr-output`, `cli-output` and `file-to-send` should be identical.\n\nWhen option `-t` is present on command line, TLS is enabled on socket. Remove the option to send and receive without TLS.\n\n## IOCP Server\nStart iocp server with TLS by\n\n```\nIocpServer.exe -t\n```\n\nor without TLS\n\n```\nIocpServer.exe\n```\n\nThen you can use the simple client to interact with it as mentioned above, like\n\n```\nSimpleSocketClient.exe localhost -t 1\u003ecli-output \u003cfile-to-send\n```\n\nYou can also try to script multiple clients interacting with an IOCP server at the same time, to validate the server's concurrency. Here's an example in Cygwin:\n\n```bash\nfor i in {1..5} ; do ./SimpleSocketClient.exe localhost -t 1\u003etest-$i \u003cfile-to-send \u0026 done\n```\n\n## TLS in a Nutshell\nhttps://gist.github.com/coin8086/1cd0411447066a5a02be6a3e493479e2\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoin8086%2Fwinsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoin8086%2Fwinsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoin8086%2Fwinsocket/lists"}