You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FastAPIWebsocketTransport integrates with your FastAPI application to handle telephony WebSocket connections. It works with telephony frame serializers to process audio streams from phone calls.
137
144
145
+
<Note>
146
+
The transport constructor raises `ValueError` if `params.allowed_origins` is
147
+
set and the connection's `Origin` header is missing or not in the allowed
148
+
list. The caller is responsible for closing the WebSocket in that case.
149
+
</Note>
150
+
138
151
See the [complete example](https://github.com/pipecat-ai/pipecat-examples/tree/main/twilio-chatbot) for a full implementation including:
--whatsapp Verify required WhatsApp environment variables are present
355
+
-v, --verbose Increase logging verbosity
353
356
```
354
357
355
358
### Key Arguments
@@ -366,6 +369,8 @@ Options:
366
369
367
370
**`--dialin`**: Enables the `/daily-dialin-webhook` endpoint for handling Daily PSTN dial-in calls. This endpoint receives webhook data from Daily when a phone call dials into your configured phone number, creates a SIP-enabled room, and spawns your bot. (It no longer requires `-t daily`, though dial-in is a Daily feature.)
368
371
372
+
**`--allowed-origins`**: Restricts which origins can connect to HTTP and WebSocket endpoints. Useful for preventing Cross-Site WebSocket Hijacking (CSWSH) attacks. When set, connections with a missing or disallowed `Origin` header are rejected. Can be specified multiple times for multiple origins. Defaults to the `PIPECAT_ALLOWED_ORIGINS` environment variable (comma-separated). Leave unset to allow all origins.
373
+
369
374
**`--esp32`**: Enables SDP (Session Description Protocol) modifications needed for ESP32 WebRTC compatibility. Must be used with a specific IP address via `--host`.
370
375
371
376
### Environment Variables
@@ -384,6 +389,10 @@ Different transports require different environment variables:
-`PIPECAT_ALLOWED_ORIGINS`: Comma-separated list of allowed origins for HTTP and WebSocket connections. When set, the runner and WebSocket transports reject any connection whose `Origin` header is missing or not in this list. Leave unset or empty to allow all origins. Example: `https://example.com,https://app.example.com`
395
+
387
396
The runner automatically uses these environment variables when creating transport sessions and authentication tokens.
0 commit comments