-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WGLMakie doesn't work properly with proxy and/or ipv6 only #1275
Comments
I admit, that I have no idea what needs to be done to support ipv6... |
setting the "listen_url" to the string "localhost" instead of "127.0.0.1" should work fine for both ipv4, ipv4+ipv6, and ipv6 only, I would think however I'm not sure it's going to solve the proxy issue. I don't know why something is contacting the proxy when it should be going direct, and I don't know who is doing it. Wherever it's being done, it should be checking the no_proxy environment variable and realizing that localhost isn't something that's proxied I will try the suggested change and report back. |
Hmm... I tried this:
So that doesn't seem to help |
Since I actually don't have an ipv6 only machine, the real main problem I'm trying to solve is that somewhere something is hitting my proxy when it should be going direct to 127.0.0.1 i just noticed that the 127.0.0.1 is hard coded in the URL and that seems wrong from an ipv6 perspective so I mentioned it. |
|
It's hard coded in the URL being accessed, as well as in the file you linked to above. Also in the call to parse an ip address in start() it calls Sockets.InetAddr(parse(Sockets.IPAddr,...)) which assumes that the URL contains a raw ipv4 address. rather than parsing the IP address out of the string, you could call getaddrinfo on the string, which will allow it to work with "localhost" or "127.0.0.1" or "::1" or any other valid identifier for a host as for the proxy: There's nothing wrong with my proxy setup, the problem is probably with the HTTP package:
somewhere something asked the HTTP package to grab the url Perhaps I will file a bug against HTTP |
I've filed this bug against HTTP: |
I don't think you can call something hardcoded, when you can actually set it to whatever value you want... If Anyways, seems like you're on the way to find the bug ;) |
configure_server! is working fine, however if I set the the listen_url to something other than an ipv4 numerical address, then https://github.com/SimonDanisch/JSServe.jl/blob/master/src/server.jl#L295 will bork during the parse..
Because you're asking it to parse(Sockets.IPAddr...) which can only accept ipv4 numerical addresses. instead call getaddrinfo(application.url) (or some prefix of application.url perhaps) also at that point, if instead of "127.0.0.1" in the listen_url config, you by default put "localhost" then it will work with ipv4 or ipv6
|
Ah ok... PRs are more then welcome, if you figure out better ways to start/set things ;) |
Ok, at first I was having problems with testing, because of the proxy based problem. But since the tests don't access foreign sites, I just eliminated the environment variables and it didn't try to use the proxy. I have a tested fix that replaces the use of 127.0.0.1 with "localhost" and uses getaddrinfo, and it seems to pass all tests. It's a little heavy-weight to do a full pull request. This is the patch... there are literally 4 lines changed one of which is a comment... if that's enough for you let me know. Otherwise I'll see about putting the pull request together. It's likely to be later this week though.
|
Thanks! |
Mainly, just that I now have to clone the repo to my github, push from my computer, write the request etc and I have about 6 hats I'm wearing, including helping two kids in online school, it's often the case that I often don't get chunks of time to get these things completed. Also in large part because I have to wind up looking up a lot of git manual pages every time I do this stuff, I just don't have operations like "changing the remote origin" memorized. But, hey, I think I can probably get it done. let me see |
OK, you were right, it really didn't take more than 5 mins even with looking up all the git commands. I've submitted the PR against JSServe with that above patch. |
Thank you, much appreciated :) |
Ooh, that's a good tip! |
As I understood, @dlakelan you didn't find a direct solution to the problem ? At least for me this is the case. I am running Pluto in a remote headless server with a configured proxy and I cannot get Working it around with The issue you raised JuliaWeb/HTTP.jl#746 is indeed handled but unfortunately As a result, maybe we should re-open the issue, since it appears it's not possible to do (or forward from server) WGLMakie visualizations when a proxy is in use. |
Can you try with: |
Looks better. Just with However when I port forward it through ssh to access it locally to my browser, error in loop
┌ Error: d291bc65-4a20-4389-ab26-b5164af07c76: Unexpected websocket server error
│ (e, catch_backtrace()) =
│ Unregistered session id: 0f54625a-cd4e-43ce-8016-04cddc3e6012. Active sessions: ["3aab6203-1088-4e
e2-af9e-8d7c3dfa604c", "3bef02e6-63cd-4444-8806-9c00439f848d", "c3a0665e-8b6c-47cb-ae31-5cf424e170cf",
"76dfccb4-db4d-4d64-8ab4-53f4d3406f39"]
│ Stacktrace:
│ [1] error(s::String)
│ @ Base ./error.jl:35
│ [2] look_up_session(id::String)
│ @ JSServe ~/.julia/packages/JSServe/gEglt/src/connection/connection.jl:160
│ [3] (::JSServe.WebSocketConnection)(context::NamedTuple{(:routes, :application, :request, :match
), Tuple{JSServe.HTTPServer.Routes, Server, HTTP.Messages.Request, RegexMatch}}, websocket::HTTP.WebSoc
kets.WebSocket)
│ @ JSServe ~/.julia/packages/JSServe/gEglt/src/connection/websocket.jl:84
│ [4] apply_handler(::JSServe.WebSocketConnection, ::NamedTuple{(:routes, :application, :request,
:match), Tuple{JSServe.HTTPServer.Routes, Server, HTTP.Messages.Request, RegexMatch}}, ::HTTP.WebSocket
s.WebSocket)
│ @ JSServe.HTTPServer ~/.julia/packages/JSServe/gEglt/src/HTTPServer/implementation.jl:52
│ [5] delegate(routes::JSServe.HTTPServer.Routes, application::Server, request::HTTP.Messages.Requ
est, args::HTTP.WebSockets.WebSocket)
│ @ JSServe.HTTPServer ~/.julia/packages/JSServe/gEglt/src/HTTPServer/implementation.jl:70
│ [6] #5
│ @ ~/.julia/packages/JSServe/gEglt/src/HTTPServer/implementation.jl:117 [inlined]
│ [7] upgrade(f::JSServe.HTTPServer.var"#5#7"{Server, HTTP.Streams.Stream{HTTP.Messages.Request, H
TTP.ConnectionPool.Connection}}, http::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.C
onnection}; suppress_close_error::Bool, maxframesize::Int64, maxfragmentation::Int64, kw::Base.Pairs{Sy
mbol, Bool, Tuple{Symbol}, NamedTuple{(:binary,), Tuple{Bool}}})
│ @ HTTP.WebSockets ~/.julia/packages/HTTP/RQd4C/src/WebSockets.jl:439
│ [8] stream_handler(application::Server, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.
ConnectionPool.Connection})
│ @ JSServe.HTTPServer ~/.julia/packages/JSServe/gEglt/src/HTTPServer/implementation.jl:116
│ [9] #invokelatest#2
│ @ ./essentials.jl:729 [inlined]
│ [10] invokelatest
│ @ ./essentials.jl:726 [inlined]
│ [11] (::JSServe.HTTPServer.var"#13#15"{Server})(stream::HTTP.Streams.Stream{HTTP.Messages.Request
, HTTP.ConnectionPool.Connection})
│ @ JSServe.HTTPServer ~/.julia/packages/JSServe/gEglt/src/HTTPServer/implementation.jl:246
│ [12] #invokelatest#2
│ @ ./essentials.jl:729 [inlined]
│ [13] invokelatest
│ @ ./essentials.jl:726 [inlined]
│ [14] handle_connection(f::Function, c::HTTP.ConnectionPool.Connection, listener::HTTP.Servers.Lis
tener{Nothing, Sockets.TCPServer}, readtimeout::Int64, access_log::Nothing)
│ @ HTTP.Servers ~/.julia/packages/HTTP/RQd4C/src/Servers.jl:447
│ [15] (::HTTP.Servers.var"#16#17"{JSServe.HTTPServer.var"#13#15"{Server}, HTTP.Servers.Listener{No
thing, Sockets.TCPServer}, Set{HTTP.ConnectionPool.Connection}, Int64, Nothing, Base.Semaphore, HTTP.Co
nnectionPool.Connection})()
│ @ HTTP.Servers ./task.jl:484
└ @ HTTP.WebSockets ~/.julia/packages/HTTP/RQd4C/src/WebSockets.jl:442 How am I supposed to register my session ? Also where did Regarding WGLMakieI cannot test WGLMakie, because it doesn't compile with these 2 dependencies: (remotewgl) pkg> st
Status `~/code/julia/remotewgl/Project.toml`
[824d6782] JSServe v1.2.9 `https://github.com/SimonDanisch/JSServe.jl.git#sd/improvements`
[ee78f7c6] Makie v0.18.3 `https://github.com/MakieOrg/Makie.jl.git#sd/new-jsserve`
[276b4fcb] WGLMakie v0.7.3
(remotewgl) pkg> precompile
Precompiling project...
✗ WGLMakie
0 dependencies successfully precompiled in 26 seconds. 201 already precompiled.
ERROR: The following 1 direct dependency failed to precompile:
WGLMakie [276b4fcb-3e11-5398-bf8b-a0c2d153d008]
Failed to precompile WGLMakie [276b4fcb-3e11-5398-bf8b-a0c2d153d008] to /u/home/wima/fchrstou/.julia/co
mpiled/v1.8/WGLMakie/jl_wpzmLo.
ERROR: LoadError: UndefVarError: Dependency not defined
Stacktrace:
[1] include
@ ./Base.jl:419 [inlined]
[2] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_pat
h::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::
Nothing)
@ Base ./loading.jl:1554
[3] top-level scope
@ stdin:1
in expression starting at /u/home/wima/fchrstou/.julia/packages/WGLMakie/BH1ZZ/src/WGLMakie.jl:1
in expression starting at stdin:1
The problem is that WGLMakie expects |
WGLMakie mainly needs to be on
You don't need it anymore, but not all functionality is replaced yet... But e.g. IJulia + Pluto should just work without it now! |
Hm. Apparently something is still wrong.. Having activated the environment (remotewgl) pkg> st
Status `~/code/julia/remotewgl/Project.toml`
[824d6782] JSServe v1.2.9 `https://github.com/SimonDanisch/JSServe.jl.git#sd/improvements`
[ee78f7c6] Makie v0.18.4 `https://github.com/MakieOrg/Makie.jl.git#sd/new-jsserve`
[20f20a25] MakieCore v0.5.2 `https://github.com/MakieOrg/Makie.jl.git:MakieCore#sd/new-jsserve`
[276b4fcb] WGLMakie v0.7.4 `https://github.com/MakieOrg/Makie.jl.git:WGLMakie#sd/new-jsserve` I have also tried with configuring I 've also tried with using WGLMakie without Pluto and I got some visualizations working and port-forwarded to my local browser. |
Can you post the output of the Javascript console (ctrl + alt + i usually)? |
<pluto-output class="rich_output " translate="true" mime="text/html"><assignee></assignee><div class="raw-html-wrapper "><div id="cab2689a-4505-44e7-bc64-8a3167d653de" data-jscall-id="17">
<div data-jscall-id="16">
<script data-jscall-id="18" src="data:application/javascript;base64,SlNTZXJ2ZS5pbml0X3Nlc3Npb24oJ2NhYjI2ODlhLTQ1MDUtNDRlNy1iYzY0LThhMzE2N2Q2NTNkZScsICgpPT4gbnVsbCwgJ3N1YicpOwo=" type="module"></script>
<canvas data-jscall-id="15" tabindex="0"></canvas>
</div>
</div></div></pluto-output>
Yes. Is there currently an option to plot a WGLMakie (or JSServe) without launching the browser ?
I have no idea right now how can this be adapted in my case. I am connecting to Pluto through a simple ssh port forwarding, so I would expect that if it works locally in the server it should also work properly remotely (since I don't really want to forward the graphic in any other machine other than the server's Pluto browser which then I access through the aforementioned port forward) |
I have a proxy situation in my network, with the following environment variables:
the simplest use case from the example web page:
results in an error message related to the use of a proxy, however in general software shouldn't use a proxy to connect to 127.0.0.1, also using the ipv4 address explicitly will in general not work on a machine with ipv6 only.
Even adding 127.0.0.0/8 to the no_proxy or NO_PROXY environment variables fails to fix this.
julia> scatter(rand(4))
<title>ERROR: The requested URL could not be retrieved</title> <style type="text/css">Error showing value of type Makie.FigureAxisPlot:
ERROR: HTTP.ExceptionRequest.StatusError(503, "GET", "http://127.0.0.1:9284/assetserver/65c7b14432db03331e0c19fc9cc39592adb2b936-JSServe.js", HTTP.Messages.Response:
"""
HTTP/1.1 503 Service Unavailable
Server: squid/4.12
Mime-Version: 1.0
Date: Sun, 29 Aug 2021 18:02:26 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 3786
X-Squid-Error: ERR_CONNECT_FAIL 111
Vary: Accept-Language
Content-Language: en
X-Cache: MISS from pirouter
X-Cache-Lookup: MISS from pirouter:3128
Via: 1.1 pirouter (squid/4.12)
Connection: keep-alive
The text was updated successfully, but these errors were encountered: