WinSocket
TLS Examples in Schannel and IO Completion Ports
Install / Use
/learn @coin8086/WinSocketREADME
TLS Examples in Schannel and IO Completion Ports
Before You Run
You 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.
Simple Server and Client
Start echo server and write what received to stdout, which is redirected to file svr-output since client may send binary data.
SimpleSocketServer.exe -t 1>svr-output
Start client to send file-to-send to server, and write what server sent back to stdout, which is redirected to file cli-output.
SimpleSocketClient.exe localhost -t 1>cli-output <file-to-send
In the end, svr-output, cli-output and file-to-send should be identical.
When option -t is present on command line, TLS is enabled on socket. Remove the option to send and receive without TLS.
IOCP Server
Start iocp server with TLS by
IocpServer.exe -t
or without TLS
IocpServer.exe
Then you can use the simple client to interact with it as mentioned above, like
SimpleSocketClient.exe localhost -t 1>cli-output <file-to-send
You 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:
for i in {1..5} ; do ./SimpleSocketClient.exe localhost -t 1>test-$i <file-to-send & done
TLS in a Nutshell
https://gist.github.com/coin8086/1cd0411447066a5a02be6a3e493479e2
Related Skills
node-connect
354.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
