- Add gateway real path implementation (06_gateway_real_path) - Add gateway cleanup tasks (07+06_gateway_cleanup) - Update Go WebSocket client and benchmark - Update Kotlin Communicator, TcpClient, WsClient and stress tests - Update TypeScript base_client, communicator, inbound_gateway, node variants, tcp/ws clients and tests - Update Kotlin and TypeScript stress benchmarks - Update roadmap milestone documentation |
||
|---|---|---|
| .. | ||
| bench | ||
| crosstest | ||
| src | ||
| test | ||
| .gitignore | ||
| CROSSTEST_CHECKLIST.md | ||
| IMPLEMENTATION_CHECKLIST.md | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
TypeScript Proto Socket
Status: available
This package implements Proto Socket protocol version 0.1 for TypeScript.
Scope
- Runtime targets: Node.js TCP, Node.js WebSocket, browser native WebSocket.
- Browser entrypoint (
proto-socket):Communicator,BaseClient,BrowserWsClient,connectBrowserWs. Has nows,node:*, orBufferdependency. - Node entrypoint (
proto-socket/node): all of the above plusTcpClient/TcpServer,NodeWsClient/NodeWsServer,connectNodeWs/connectNodeWssusing Node.js built-ins.
Import
// browser
import { connectBrowserWs } from "proto-socket";
// node
import { connectNodeWs, NodeWsServer, TcpClient } from "proto-socket/node";
Runtime Dependencies
The TypeScript runtime has no non-protobuf package dependencies. The current canonical message codec and Node.js TCP/TLS/WebSocket transports are implemented with native platform APIs, so this package has no runtime dependencies at all.
Proto Sync
The canonical schema lives in ../proto/message_common.proto. The TypeScript packet codec in
src/packets/ must stay wire-compatible with that schema. After proto changes, run from the
repository root:
tools/check_proto_sync.sh
Validation
cd typescript
npx tsc --noEmit
npx vitest run
cd go
go run ./crosstest/go_typescript.go
cd dart
dart run crosstest/dart_typescript.dart
cd kotlin
./gradlew run -PmainClass=com.tokilabs.proto_socket.crosstest.KotlinTypescriptKt
cd python
python3 crosstest/python_typescript.py
cd typescript
./node_modules/.bin/tsx crosstest/typescript_dart.ts
./node_modules/.bin/tsx crosstest/typescript_go.ts
./node_modules/.bin/tsx crosstest/typescript_kotlin.ts
./node_modules/.bin/tsx crosstest/typescript_python.ts