You don’t have to manually replace the session URL with an IP address—if you want the iframe to point to a specific IP, you simply need to launch Phoenix with that IP as the host. For example, by setting the host parameter in px.launch_app (or by setting the PHOENIX_HOST environment variable), the session.url property will automatically be generated with that IP:
```
import phoenix as px
# Launch Phoenix with a specific IP address (e.g., 192.168.1.100)
session = px.launch_app(host="192.168.1.100", port=6006)
print(session.url) # This should show "http://192.168.1.100:6006/"
```
Then, when embedding the URL in your iframe (for instance, using Streamlit’s components.iframe), it will connect to the desired IP address without any manual substitution.
Would you like more examples of configuring the host parameter or further details on embedding in an iframe?
---
Sources:
- <https://arize-phoenix.readthedocs.io/en/latest/api/session.html|Phoenix API Reference on launch_app>