SimonDanisch / Bonito.jl

Serving JS to the browser
MIT License
212 stars 31 forks source link

`WGLMakie` plots not rendering over SSH #230

Closed vpuri3 closed 2 months ago

vpuri3 commented 4 months ago

I am using Bonito + WGLMakie to view visualizations done on my remote machine. The issue I am facing is that WGLMakie plots are not rendering in my browser on my local machine.

Here's my workflow: I log into my remote machine with

$ ssh -L 8080:localhost:8700 remote-machine

and run the following Julia script.

julia> using Bonito, WGLMakie

julia> WGLMakie.activate!()

julia> isdefined(Main, :server) && close(server)

julia> app = App((sess, req) -> DOM.div(DOM.h1("Plot below"), lines(rand(10)), DOM.h1("Plot above")));

julia> server = Bonito.Server(app, "127.0.0.1", 8700);

The output on http://localhost:8080 is Screenshot 2024-06-04 at 3 57 10 PM

When I run the same script locally, I get the expected result: Screenshot 2024-06-04 at 4 00 01 PM

AlexisRenchon commented 2 months ago

you need a proxy_url https://simondanisch.github.io/Bonito.jl/stable/deployment.html

server = Bonito.Server(app, "127.0.0.1", 8700; proxy_url = "http://localhost:8080")

SimonDanisch commented 2 months ago

Yeah that's it ;) Easier to just do ssh -L 8080:localhost:8080