-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feature Request: stream to the outside world #8
Comments
I like the blog post a lot, thanks for putting it together. I had not heard of ngrok before, the service looks quite useful and definitely something we could add support for. Seems like ngrok should have its own interface package but it looks like there is a nice local rest API for querying the tunnel. |
Brilliant! A baby step toward integration, the following helper command opens a new command window and runs the ngrok utility with the local server URL, so all you have to do is copy the ngrok.io URL and share it with your students.
|
Works for me! Thank you |
I'm wondering if anyone else is having trouble with ngrok (or similar) recently. I used ngrok last fall to stream out my live code files and it worked great. However, now I'm trying to use it and all I see is a blank page. Everything else appears to be working (the ngrok interface shows me hitting the page), but the page remains blank. Any thoughts? BTW I'm on an M1 Mac with Monterey 12.3.1, R v 4.1.3, livecode v 0.1.0.9000. I also get the same result using an Intel Mac with BugSur 11.5.2, R 4.1.0 and the same livecode version. One more update - tried on the newest R 4.2.0 on my intel mac, same story. When I serve an R file that contains the following: library(dplyr)
library(ggplot2)
dat <- mtcars %>% select(c(1, 3:7))
combs <- combn(names(dat), 2) %>%
t() %>%
as.data.frame()
plots <- purrr::map2(combs$V1, combs$V2, ~ggplot(dat, aes_string(x=.x, y=.y)) + geom_point())
plots This is what ngrok serves on the other end.
|
@davidaarmstrong, since version 2.3 of You can revert to ngrok http http://xxx.xx.xx.xxx:yyyy --scheme http --scheme https |
@nareal Apologies for not thanking you for this earlier. It just became relevant to me again, so I looked back to see what the status was. Your suggestion worked perfectly - it really saved my lecture today. |
@davidaarmstrong I'm glad it helped. |
This solution is not working for me. I'm on ngrok 3.2.2 and when I open the http link it gets redirected to the https version and I get the blank page again. I was able to work around the issue by using http://localhost.run/. livecode::serve_file("file", ip = "127.0.0.1") and then ssh -R 80:localhost:xxxxx localhost.run on the terminal, replacing the xxx with the proper port. |
I believe the problem is that the browser is trying to connect to the websocket using an insecure connection (ws). This can be solved by adding a directive to upgrade insecure requests. I have made a pull request (#16) that adds a parameter that allows this when creating the server:
and then ngrok will work as expected when called by:
|
I've found that is relatively simple to enable public access to the file served by
livecode
using a free service like ngrok.I made a brief tutorial, here: https://bitsandbricks.github.io/post/code-live-from-rstudio-and-share-it-with-the-world-in-real-time/
Could ngrok integration be rolled into livecode? i.e in a similar fashion to the already present bit.ly support.
The text was updated successfully, but these errors were encountered: