Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

r - Hosting and setting up own shiny apps without shiny server

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...