在没有闪亮服务器的情况下托管和设置自己的闪亮应用程序 [英] Hosting and setting up own shiny apps without shiny server

查看:29
本文介绍了在没有闪亮服务器的情况下托管和设置自己的闪亮应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力为我的同事提供闪亮的应用程序,而无需他们运行,甚至无需安装 R.

所以我阅读了这个网页并找到了这句话:

<块引用>

如果您熟悉网络托管或可以访问 IT部门,您可以自己托管您的 Shiny 应用.

作为网页共享"部分下.

我该怎么做?

问题是我的公司在网络托管和安全等方面受到某些限制,并且(目前)不会为闪亮的服务器专业版付费.

但上面这句话让我希望自己能建立一些东西来说服他们.

解决方案

如果您的 PC 和您同事的 PC 属于同一个 LAN,这很容易实现.只需通过以下方式运行您的应用:

runApp(host = "0.0.0.0", port = 5050)

通过 host 参数设置的值表示接受任何连接(不仅仅是来自 localhost).port 参数可以采用您想要的任何值(只需确保避免选择其他服务使用的端口,例如 sshhttp).然后,记下你的本地IP(如果你在linux下,你可以通过ifconfig看到它).假设您的 IP 是 192.168.1.70.您的同事可以通过在浏览器的地址栏中插入 192.168.1.70:5050,即您的 IP 后跟 : 和您选择的端口号来使用您的应用.

如果您想从 LAN 外部访问,当有人通过 5050 端口连接到您的公共 IP 时,您可以将路由器定向到您的 PC.

I'm trying to make shiny apps available to my coworkers without them having to run or even have R installed.

So I read this webpage and found this sentence:

If you are familiar with web hosting or have access to an IT department, you can host your Shiny apps yourself.

under the 'Share as a web page'-section.

How can I do this?

The problem is that my company is bound to certain restrictions regarding web hosting and security and so on, and will not (for now) pay for a shiny-server-pro.

But the sentence above gives me hope to set up something ourselves to convince them.

解决方案

If your PC and your coworkers PCs belong to the same LAN, this is pretty easy to achieve. Just run your app through:

runApp(host = "0.0.0.0", port = 5050)

The value set through the host argument says to accept any connection (not just from localhost). The port argument can assume any value that you want (just assure to avoid to select ports used by other services like ssh or http). Then, take note of your local IP (if you are under linux, you can see it through ifconfig). Say your IP is 192.168.1.70. Your colleagues can use your app by inserting in the address bar of their browser 192.168.1.70:5050, i.e. your IP followed by : and the port number you selected.

If you want access from outside your LAN, you can direct your router to your PC when someone connect to your public IP through the 5050 port.

这篇关于在没有闪亮服务器的情况下托管和设置自己的闪亮应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆