Available
amalgame-net-websocket
RFC 6455 WebSocket client: text frames over ws://.
Overview
WebSocket client (RFC 6455) over plain TCP (ws://). The SHA-1 + Base64 handshake is computed inside the package, without OpenSSL.
Features
- ✓RFC 6455 client (no server)
- ✓Text frames only
- ✓Automatic pong to server pings
- ✓Close frame sent by
Closeand honored on receipt
Planned for v0.2: wss:// (TLS).
Example
Minimal usage example — copy-paste runnable after install.
amc package add net-websocket
import Amalgame.Net.WebSocket
public class Program {
public static void Main(string[] args) {
let ws = WebSocket.Connect("echo.example.com", 80, "/ws")
if (ws == null) {
Console.WriteLine("connect failed")
return
}
WebSocket.SendText(ws, "hello")
let reply: string = WebSocket.ReceiveText(ws)
Console.WriteLine("got: " + reply)
WebSocket.Close(ws)
}
}
At a glance
- License: Apache-2.0
- Install:
amc package add net-websocket - Source: amalgame-lang/amalgame-net-websocket
- Official index: amalgame-lang/packages-index