Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

sdk docs: mention WS header auth (avoid URL secrets) #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
enyst wants to merge 3 commits into OpenHands:main
base: main
Choose a base branch
Loading
from enyst:blackcat/oh-tab-h3g-ws-header-auth
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions sdk/arch/agent-server.mdx
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@ async with websocket_connect(url) as ws:
print(event["content"])
```

**Authentication note (important)**:

The Agent Server accepts WebSocket authentication in two ways:

- **Recommended (non-browser clients): via headers during the WebSocket handshake**
- `X-Session-API-Key: <key>`
- **Backward compatible (typically browser clients): via query string**
- `?session_api_key=<key>`

**Precedence**: if `session_api_key` is present in the query string, it overrides any header-based authentication.

Rationale: avoid putting secrets in URLs when you can (URLs can leak via logs, proxies, etc.). Browsers typically cannot set custom headers on WebSocket connections, so query-parameter auth may be required in browser environments.

**Why streaming?**
- Real-time feedback to users
- Show agent thinking process
Expand Down

AltStyle によって変換されたページ (->オリジナル) /