mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-05-25 16:00:35 +00:00
e304dce40e
- Replace config/config.example.json with V3 format (version: 3, api_keys array, channel_list) - Update config-versioning.md: version 2→3, ConfigV2→ConfigV3, CurrentVersion=3 - Update 7 project READMEs: api_key→api_keys, add version: 3 to quick-start examples - Update 12 security docs (ANTIGRAVITY_AUTH + credential_encryption): api_key→api_keys - Update provider-refactoring.md: api_key→api_keys in all config examples - Update security_configuration.md: api_key→api_keys in Before example - Update 3 channel docs: channels→channel_list in JSON examples
pico-echo-server
Minimal Pico Protocol WebSocket server for testing the pico_client channel.
Usage
go run ./examples/pico-echo-server -addr :9090 -token secret
Flags
| Flag | Default | Description |
|---|---|---|
-addr |
:9090 |
Listen address |
-token |
(none) | Auth token; empty disables auth |
How it works
- Listens for WebSocket connections at
/ws - Authenticates via
Authorization: Bearer <token>header or?token=<token>query param - Prints received
message.sendcontent to stdout - Responds to
pingwithpong - Lines typed into stdin are broadcast as
message.createto all connected clients
Testing with pico_client
-
Start the server:
go run ./examples/pico-echo-server -token mytoken -
Configure
pico_clientin yourconfig.json:{ "channel_list": { "pico_client": { "enabled": true, "url": "ws://localhost:9090/ws", "token": "mytoken", "session_id": "test-session" } } } -
Start picoclaw — the client connects and you can exchange messages interactively via stdin/stdout.