can i get the ip address of remote participant?
# ask-ai
f
can i get the ip address of remote participant?
t
Thanks for reaching out, Deo. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can obtain the IP address of a remote participant in a LiveKit session, but the approach depends on your setup and access level: • Client-side (SDK): If you control the client, you can use WebRTC statistics to extract the remote participant's IP address. For example, the JavaScript SDK provides a
getConnectedAddress()
method, and the Flutter SDK has similar functionality. These methods analyze WebRTC stats to find and return the IP and port of the remote peer. • Server-side: The LiveKit server automatically collects the participant's IP address during the connection handshake, using HTTP headers (like
CF-Connecting-IP
,
X-Forwarded-For
, or the remote address if these are not set). Be aware that the IP you retrieve may be a NAT, proxy, or CDN IP, not necessarily the participant's actual device IP, and should be accessed only when necessary for privacy reasons. The exact steps depend on your SDK and use case. If you need sample code or details for a specific language or environment, let me know which SDK or integration you're working with. Sources: src/room/PCTransport.ts | lib/src/core/engine.dart | pkg/rtc/room.go
f
i'm using python serverside sdk
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!