Skip to content
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

Serving an app with basic interactivity fails #270

Closed
cstjean opened this issue Nov 12, 2024 · 5 comments
Closed

Serving an app with basic interactivity fails #270

cstjean opened this issue Nov 12, 2024 · 5 comments

Comments

@cstjean
Copy link

cstjean commented Nov 12, 2024

(Disclaimer: this is one of those "This is so simple it can't possibly be a bug; I must be doing something wrong" issue, but since discourse had nothing to say, I'm reporting it here)

This simple code:

using Bonito, Bonito.Observables
import Bonito.TailwindDashboard as D

app = App(DOM.div(D.Slider("nsamples", 1:200, value=100)), title="hello world")

port = 9384
url = "0.0.0.0"
server = Bonito.Server(app, url, port)

Works fine on http://localhost:9384/

image

but the interactivity fails and the visual aspect is off on http://my_ip:9384

image

@etpinard reports that

image

pops up in the dev tools. When served, the app should not look up anything in localhost.

@SimonDanisch
Copy link
Owner

You need to set the proxy_url:
https://simondanisch.github.io/Bonito.jl/stable/deployment.html#Proxy-Julia-Hub

@cstjean
Copy link
Author

cstjean commented Dec 3, 2024

Thank you for the answer. I tried today for the second time to follow this advice, and I'm still stuck with the same behaviour. I tried adding the

server.proxy_url = ".../$(server.port)"

line, no luck. I don't understand why a proxy is involved if I'm entering my own IP address. It looks from my searches online that the request does not leave my computer at all in that case. Furthermore, I tried:

C:\Users\abcde>netsh winhttp show proxy

Current WinHTTP proxy settings:

    Direct access (no proxy server).

Though apparently it's not that reliable.

Genie works out-of-the-box for me, even on my own IP, with no proxy configuration. Is it using a different technology?

EDIT: perhaps important to note that I am working in a harsh IT environment, so these failures are not unexpected.

@cstjean
Copy link
Author

cstjean commented Jan 7, 2025

server = Bonito.Server(app, url, port, proxy_url="http://server.ip.address:$port", verbose=0) worked out for us.

Looking at the docs again:

{667FFBD2-7C8A-4D50-9AA9-CC1EAD5B04E5}

Is that what the ... is supposed to mean? Like: "Replace ... with your own IP/server address"? I thought .../$(server.port) was meant to be copy-pasted verbatim. 😓 I can make a PR to clarify the docs if anyone can confirm.

@cstjean
Copy link
Author

cstjean commented Jan 7, 2025

Correction: it works in Firefox and in Chrome, but in Edge styling is off and it is not interactive (though it works fine on localhost). There's a decent chance that Edge has been gimped by the IT department, but if anyone else has had issues with Edge, please let me know.

@cstjean
Copy link
Author

cstjean commented Jan 7, 2025

Resolution: some internal IT rule had Edge running it in IE-only compatibility mode, which of course ruined it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants