does livekit receive and respind to OPTIONS from S...
# ask-ai
w
does livekit receive and respind to OPTIONS from Service providers?
t
Thanks for reaching out, Marius. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Absolutely! LiveKit is designed to gracefully handle and respond to OPTIONS requests from service providers. This is really important because it supports CORS (Cross-Origin Resource Sharing) and preflight requests across different endpoints, making everything work smoothly. Here’s a quick overview to help you understand: • WHIP Endpoints: When OPTIONS requests come to WHIP endpoints (like
/whip/v1
), LiveKit responds with the right CORS headers such as
Access-Control-Allow-Origin: *
,
Access-Control-Allow-Methods: PATCH, OPTIONS, GET, POST, DELETE
, and
Access-Control-Allow-Headers: *
, and returns a 200 OK status. This helps keep things seamless. • Other API Endpoints: OPTIONS requests to places like
/health
and
/completions
are handled in a similar way, with CORS headers included and a simple 200 OK response. • Ingress Service: For media ingestion endpoints (such as
/{app}
and
/{app}/{stream_key}
), OPTIONS requests get a 204 No Content status back, along with wildcard CORS headers. All of this is set up to ensure smooth compatibility with your service providers, browsers, and API clients. If you have any more questions or need further clarification, I’m here to help! Sources: pkg/whip/server.go | pkg/service/whipservice.go | tools/server/tests/unit/test_security.py
w
are there any way for me to check these endpoints in livekit cloud
t
I'd be happy to help you check LiveKit endpoints in LiveKit Cloud! You can use the region discovery API to easily retrieve the available regional endpoints dynamically. Here's a simple way to do it: 1. Start by converting your WebSocket URL (for example,
wss://your-subdomain.livekit.cloud
) to HTTPS and then add
/settings/regions
at the end. So it would look like this:
https://your-subdomain.livekit.cloud/settings/regions
. 2. Next, send an HTTP GET request to that endpoint. 3. Make sure to include an Authorization header with a Bearer token (like
Authorization: Bearer <access_token>
) that has the right permissions to access this information. When you do this, you'll get a response listing the regions along with their URLs and distance details, which should be really helpful. Also, just so you know, LiveKit Cloud uses specific domains for signaling and media traffic — for example,
*.livekit.cloud
for signaling and
*.turn.livekit.cloud
for TURN services. If you have any questions or need more details, please don't hesitate to ask. I'm here to help! Sources: livekit-api/src/signal_client/region.rs | livekit-android-sdk/src/main/java/io/livekit/android/room/RegionUrlProvider... | Configuring firewalls | LiveKit Docs | SIP trunk setup | LiveKit Docs
w
by doing so i would be able to view OPTIONS, BYE and other responses?
t
Thank you for reaching out! The region discovery API is primarily designed for routing and regional compliance, so it doesn’t directly expose SIP signaling messages like OPTIONS or BYE. But don’t worry—there are definitely other ways to keep an eye on these messages, such as server-side logging, custom instrumentation, or using external SIP monitoring tools. To help you better, could you share a bit more about what you’re aiming to achieve? For example: • Are you trying to debug SIP signaling issues? • Do you need logs for compliance purposes or real-time monitoring? • Are you working with LiveKit Cloud or a self-hosted setup? Once I have a clearer picture, I’d be happy to guide you toward the best solution for your needs. Sources: SIP cloud and region pinning | LiveKit Docs | pkg/siptest/client.go
w
yes, i am trying to see if I receive OPTIONS
t
To help you check if you’re receiving OPTIONS requests, here are a few friendly ways you can try: • Server-Side Logging: If you’re using LiveKit Cloud, OPTIONS requests are usually logged as part of the SIP server’s internal workings. You can take a peek at these logs through LiveKit Cloud’s monitoring or logging tools, depending on how your setup is configured. • Custom Instrumentation: Another option is to add logging to your SIP client or gateway. This way, you can easily see if OPTIONS requests are coming in and being handled. • External Monitoring Tools: Tools like Wireshark or SIPp are great for capturing and examining SIP traffic. They let you watch OPTIONS requests and other SIP messages live, which can be really helpful. If you’d like a hand accessing server logs or want some help setting up monitoring, just let me know what kind of deployment you have (like LiveKit Cloud or self-hosted). I’m here to guide you through it!