Genie Discord forum
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
I've noticed that things aren't working so well when the server isn't actually connected to the world-wide-web, hear me out: The computer that is running Julia+Genie serving the app, and the single client that is viewing and interacting with the app, are both connected to the same physical router. But this router is not connected to the web (I'm in a university that restricts quite heavily what can be opened up to the world).
I'm assuming that the issues I'm seeing depend on the fact that Genie is attempting to retrieve artifacts from the web...?
Is there a way for me to have an app function in this kind of "offline mode"?
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
What sort of issues are you having? If I'm not wrong, the only things that are pulled from the internet are the genie logos, as configured in the default layout
https://learn.genieframework.com/docs/reference/reactive-ui/adding-js-libraries#using-a-layout
Can you take a look at the browser' developer tools to see if there's any errors? For instance, I get this for missing assets in one of my apps
![](https://cdn.discordapp.com/attachments/1197485005891440710/1197489753474474034/Screenshot_2024-01-18_at_11.35.55.png?ex=65bb743d&is=65a8ff3d&hm=927614255c5333edece2e48823227c8c7887940d9826c1d898d6d8e08bd187bf&)
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
Here's what it looks like (not the upload and download buttons) and the console output.
![](https://cdn.discordapp.com/attachments/1197485005891440710/1197492719531081788/Screenshot_from_2024-01-18_11-45-40.png?ex=65bb7700&is=65a90200&hm=9985ab7139fcca503cf94fa597568bf45d2bd65dce62764b3ed7cb6b9917d950&)
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
This totally looks like a websockets issue. Is it possible that your router is blocking ws connections?
- Are you running the app behind a proxy like NGINX? If so, this requires websocket-specific config https://learn.genieframework.com/docs/reference/workflow/nginx-reverse-proxy
- Are you able to access the app normally from localhost? If so, then it's definitely the router. You could try running chromium in headless mode to test this
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
Are you running the app behind a proxy like NGINX? If so, this requires websocket-specific config No. Are you able to access the app normally from localhost? Not easily, this is served from a headless Raspberry Pi without a screen or X. If so, then it's definitely the router. I wonder how I'll be able to affect that... You could try running chromium in headless mode to test this If you mean locally on the server, then, that would be hard without a display.
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
that's why I suggested headless chromium, you can run it without a display and access its debug info at a web address
https://developer.chrome.com/blog/headless-chrome
Another option is to create a MWE to check if it is indeed a websocket issue.
https://learn.genieframework.com/docs/reference/server/websockets
Give me a few mins and I'll share something
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
Here, save this snippet from the docs to a websockets.jl
script and run it with include("websockets.jl")
using Genie, Genie.Router, Genie.Assets
Genie.config.websockets_server = true # enable the websockets server
route("/") do
Assets.channels_support()
end
up() # start the servers
If you now open a browser and check the network tab in the developers tool (filter by WS), you should see something like this
![](https://cdn.discordapp.com/attachments/1197485005891440710/1197585813903511682/Screenshot_2024-01-18_at_17.55.48.png?ex=65bbcdb4&is=65a958b4&hm=ad7ec8c4d6309c984bfb593394a06eaf45e662b1297552fde0afe992efe401f2&)
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
or an error message in case the WS channel was not found
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
Will do! Thank you. I'll report back here tomorrow...!
![Author Avatar](https://cdn.discordapp.com/avatars/679661866166910986/f3ed85f7a3e27b92039307687c03613a.png?size=512)
Looks good to me. Note that I changed the up()
to up(8000, "0.0.0.0")
so it'll work in my setup (RPI server connected to a router, laptop client connected to same router).
What do you suggest now? How exactly would the headless chrome thing work? I start the Genie server on the RPI, and then I use the headless mode of chromium to locally navigate to 0.0.0.0:8000
, and then see its report?
![](https://cdn.discordapp.com/attachments/1197485005891440710/1197818035701022791/image.png?ex=65bca5fa&is=65aa30fa&hm=c8aa9f77add7167a8fd87766d1db73a53830b66d71be37c3a68a12bd28e134ea&)
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
you run chrome from the RPI and open your local genie app. then open a browser from your computer and access chrome's debug page
chrome --headless --remote-debugging-port=8007 http://localhost:8004
Full disclosure: I haven't tested this so I'm not sure you'd be able to connect to the debugging port from another machine
![Author Avatar](https://cdn.discordapp.com/avatars/743412727464067154/bc30abeb49653e9978c0f7c90f4486a8.png?size=512)
Also, please make sure you update the packages to the latest version. There've been some changes to the channels in the last release which could solve the problem. If this doesn't work and the headless mode doesn't give any info, can you open an issue on GH with the logs and all necessary info? We'll help you out there