allow others to see your Sinatra local server thro

2019-08-02 03:31发布

It's really difficult to explain. But basically, I have an amazon instance, and I want to ssh into it and run a local server on it with sinatra. so I would ssh into the amazon instance, git clone my repo, and run ruby config.ru. Then I want someone else to be able to see that exact local server that is being ran. One of the things I've done is added a security group, port 4567 HTTP so that I can access it via public dns. It works on a rack app but it doesn't work on the sinatra, I've even tried a 'hello world' sample app to try to get it working.

1条回答
来,给爷笑一个
2楼-- · 2019-08-02 03:46

I'm not sure if there is a specific reason that you want to do this from an Amazon server or not, but if you just want someone else to see your sinatra app, you could simply use localtunnel.

Using this, you can simply run localhost on your OWN computer, then run localtunnel PORTNUMBER and it will give you a URL that your app will now be visible from. You can then give that URL to anyone you want.

Example of use:

$ ruby myapp.rb

$ localtunnel 4567

A URL will then be displayed for you to copy-paste to a friend. Easy as that.

I use this a lot when developing web apps to be mobile friendly and want to quickly look at the app on my phone without having to deploy to a server.

查看更多
登录 后发表回答