How to see “rails s” from other ip or ssid - ruby-on-rails

I wanna see the local web development built by rails from other ip.
I mean when I run “rails s” I can see web which I built.
And I wanna share it to my friend.
And I know I can see the same page from other devise if it is connected to the same wifi.
But how I can see local developing web from far away like other wifi.
I don’t think it’s impossible.
Because in aws cloud9, I can see the preview, even ec2 is not local server.
How does it work?

You can use a tool called ngrok. So you start your local server, like you're currently doing rails s, then in a second tab you can run ./ngrok http 3000. It will provide you both an http and https url which can be accessed.

Related

How to use FTP via a proxy in Rails?

There is an FTP server that I can connect to on my development machine using FileZilla or the Rails app I'm working on. But as soon as I deploy the app to Heroku, the exact same connection parameters time out. My best guess is that the server blocks IP ranges that include Heroku, or dynamic IPs in general. It is not a configuration problem because the deployed app can connect to other FTP servers without issue.
To get around this problem, I'm trying to use a QuotaGuard static URL as a proxy, the add-on for which I've already provisioned and have an ENV variable for. The problem is that this static URL is in the form http://username:password#subdomain.domain.com:9293.
How can I use this to handle an FTP connection?
Current code (works locally, times out on Heroku):
Net::FTP.open(host, username, password) do |ftp|
ftp.chdir(some_directory)
# some logic here about which files to download
end
I've checked the Ruby docs for Net::FTP and Net::HTTP for more information. FTP only seems able to use a SOCKS proxy, but HTTP seems more flexible. Could I use the static URL as a SOCKS proxy by ignoring the http:// prefix? Could I restructure the logic so that I can GET each FTP URL I need via HTTP?
I've also looked into using ProxyChainRB to do this but so far not having any luck since I'm running into the same issue of passing the proxy into an FTP connection.
Are there existing libraries that do this? Is there maybe a simpler solution I'm not seeing here?

ddns and port forwarding on a huawei hg633

Has anybody succedeed in creating a web server at home using a huawei hg633 router ?
I started by using the no-ip service and didn't get very far, as stated in this document this router is not compatible with no-ip.
So I tried using duckdns, following the instructions in the same document but that didn't work either. I also read in this relatively old post that dynamic dns is broken on those routers. In fact when I save my ddns settings, the password looks truncated.
Any port forwarding I set on my router doesn't seem to work, but that's probably related with the problems above (?)
Anything else I could try here ?
Thanks a lot !
For the record, my web server works, I can access it from within my network.

Accessing SimpleHTTPServer on iPhone

I'm developing with WebVR and I'm serving my HTML using the SimpleHTTPServer on my Mac. I want to figure out a way to access this website on my iPhone so I can see what I have created with my Google Cardboard.
I looked through a bunch of stack questions and none of them talked specifically about accessing a local website that is being served via SimpleHTTPServer
I tried getting my ip address and then concatenating the port
Ex. xxx.xx.xx.x : 8000
But it didn't work :( Also, both my phone and computer are on the same network too
Says This site can't be reached. IP_ADDRESS took not long to respond
The way I tried is the correct way. I was using school wifi so I'm assuming they're configured in a way that we aren't able to do that. Once I got home and tried on my local connection, it worked like a charm!

How can I view my rails localhost from other devices on the network?

How can I connect to a rails localhost (over wifi) from my mobile phone.
I found my network IP. I've turned off my firewall. I've browsed to my_ip:3000 from my phone.
It takes like 20 seconds to load, and then its a page with no css, angular mixed in {{flashMessage}} and few to no images.
So it looks like I'm connecting, but I really don't understand what the problem is.
Any guesses?
EDIT:
I tried my_ip:3000 from the local computer running the thin server: works fine.
Also I just used ngrok to create a local tunnel. It connects, and looks the same as my phone (no css and angular mixed in). I'm thinking it might be some problem with assets or sprockets now.
Check out ngrok - it creates a tunnel to your local machine and exposes it online (only while the service is running).
https://ngrok.com/

Response time of web application using different url

I have a very basic doubt regarding web application url.
Suppose a web application is running locally on my machine.
Will there be any difference in the response time if I access the application using below two url ?
http://localhost:8080/SomeApplicationContext
http://hello:8080/SomeApplicationContext -- Assuming my machine name is hello
depends on whether or not you have hello in your hosts file. (same place where localhost is defined) if its not, then yes because your computer will have to check with DNS before it can access the resource, in which case the difference will close to the round trip latency of that request.
No difference, You can run the script/coding using http://localhost:8080/SomeApplicationContext from your own machine only, if you like to run this program from other pc/system you can use the http://hello:8080/SomeApplicationContext url ( you can run this url from your own machine also).
I hope this is perfect.
no. Why would that be? Response time depends on servers ability to serve the content -- that is latency in processing teh request and the other is network latency. In your case both are the same. So, no difference.
localhost or hello, both of them must be defined in your hosts file. Your OS looks to hosts file (such as /etc/hosts in many Linuxes or %windir%/system32/drivers/etc in some Windowses) if it cannot find it in there, OS asks a DNS server for server ip.
In your situation, both must be defined in your hosts file. No change in network latency.
But if you mean different domains pointing same IP, then it depends on how your server application (apache, nginx, IIS etc.) handles different domain names.

Resources