Jssmp
Java implementation of the Stupid-Simple Messaging Protocol
Install / Use
/learn @redbooth/JssmpREADME
jssmp
jssmp is a Java implementation of the Stupid-Simple Messaging Protocol.
License
BSD 3-clause, see accompanying LICENSE file.
Dependencies
Example usage
Client
// given: SSLEngine sslEngine;
SSMPClient c = new SSMPClient("localhost", 1234, new HashedWheelTimer(),
new NioClientSocketChannelFactory(), () -> new SslHandler(sslEngine),
e -> System.out.println("event: " + e));
c.connect(SSMPIdentifier.fromInternal("foo"),
SSMPIdentifier.fromInternal("secret"), "NotARealSecret",
new ConnectionListener() {
@Override public void connected() { System.out.println("connected"); }
@Override public void disconnected() { System.out.println("disconnected"); }
});
SSMPResponse r = c.request(SSMPRequest.ucast(SSMPIdentifier.fromInternal("bar"),
"Hello World!")).get();
System.out.println("response: " + r);
Server
// given: SSLEngine sslEngine;
SSMPServer s = new SSMPServer(new InetSocketAddress("localhost", 1234),
new HashedWheelTimer(), new NioServerSocketChannelFactory(),
() -> new SslHandler(sslEngine),
new Authenticator() {
@Override public boolean authenticate(SSMPIdentifier id, SSMPIdentifier scheme, String cred) {
return scheme.toString().equals("secret") && cred.equals("NotARealSecret");
}
@Override public ChannelBuffer unauthorized() {
return ChannelBuffers.wrappedBuffer("401 secret\n".getBytes(StandardCharsets.US_ASCII));
}
});
s.start();
Notes
The server implementation was written for in-process integration testing. It did not go through the kind of extensive testing and optimization required to be considered production-quality.
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate 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
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
