Replies: 1 comment 9 replies
-
If the target use case is using the proxy with LV, then for an initial version it could probably use longpoll as the socket transport. |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Kino.Proxy
currently doesn't support websockets. This makes it harder to use LiveView in cloud-hosted notebooks, by requiring a new HTTP server to be started on a different port e.g. using PhoenixPlayground. However, since most servers will only expose ports 443 & 80 to the internet, those newly opened ports can't be accessed.I managed to work around this by manually opening additional ports on my Livebook server machine, but that's not really an option for other users who don't also control the underlying infrastructure. If I wanted to enable other users of the Livebook instance to experiment with Liveview, I would have to pre-emptively open a lot of ports, and hope users keep trying until they find an unused one they can map to. This gets even worse when considering deployments to Teams App Servers, since there's no real way to manage port allocations and prevent clashes.
The ideal solution would be for us to be able to use Liveview inside our notebooks over the existing HTTP(s) port via the Kino Proxy. This could work either by proxying websocket traffic to the existing Phoenix Endpoint, perhaps with some identifying information, or by starting a separate endpoint on a random port on the same host, and proxying traffic to that.
In principle, this doesn't need to be too hard (we wrote a websocket proxy in Go last year), but I don't know if there are specific blockers or complications with doing it inside Livebook?
Either way, for your amusement, I've included a snippet from my
fly.toml
, where I now expose an additional range of ports from10000
to10100
:Beta Was this translation helpful? Give feedback.
All reactions