I'm trying to integrate the Twilio API into my Rails app. The tutorial I found suggested using ngrok to put my app on the internet (rather than working on localhost). I've installed and upnzipped ngrok, and when I try to call it from the directory it is in, I get:
-bash: ngrok: command not found.
Does anyone know what my problem might be? Also could anyone explain what ngrok does vs deploying to heroku? If heroku would work the same, I would just do that. I'm new to using APIs, though, so I'm not clear on why I'm using ngrok.
Thanks!
If the binary is not located in one of the folders stored in the environment variable $PATH you have to provide at least a relative path to your current location. So if you are in the same folder as the binary then you have to call it with ./ngrok
To access from any directory I had to move the binary to $PATH
mv ngrok /usr/local/bin
in order to call executable from everywhere.
UPDATE: brew install ngrok no longer works because:
Error: No available formula with the name "ngrok"
Upstream sunsetted 1.x in March 2016 and 2.x is not open-source.
So you'll need to download binary from https://ngrok.com/download
As for question "What does ngrok do vs Heroku?", ngrok is totally different than Heroku, which is more complex. Ngrok allows you to expose a running local server over the internet using a secure tunnel. Heroku is a cloud hosting platform for web applications. To use ngrok you can just run your local server and expose it via ngrok. Anyone who connects via ngrok to your server is actually communicating to a server running you YOUR local machine. With Heroku, your application is running on hosted virtual machines in the cloud. That is an oversimplification, but in short, NGROk is good for very fast testing of your server by some remote users. It can also be useful for transferring files / data etc. from inside a virtualized environment i.e. a cloud ssh session.
Below Trick did the work for me
I have downloaded the ngrok from below site :
https://ngrok.com/download
unzip the folder and put the ngrok file with extention (Unix Executable File)inside
/usr/local/bin folder.
the command has changed to: ngrok http 80
Examples from ngrok:
ngrok http 80 # secure public URL for port 80 web server
ngrok http -subdomain=baz 8080 # port 8080 available at baz.ngrok.io
ngrok http foo.dev:80 # tunnel to host:port instead of localhost
ngrok tcp 22 # tunnel arbitrary TCP traffic to port 22
ngrok tls -hostname=foo.com 443 # TLS traffic for foo.com to port 443
ngrok start foo bar baz # start tunnels from the configuration file
Related
I tried to get a public URL for my tunnel using Ngrok
I installed and extracted Ngrok with my authenication token
In order to make a local tunnel I made a server in my web application directory using the "http-server" command in Command promt using nodeJs ( it gives port 8080 by defualt)
I opend another terminal and entered "ngork http 8080" command. It gave me the URL for port 8080 but when i ran the URL on chrome it says "site can't be reached"
what's the issue?
Is it possible to make a serverless Icecast server?
I'm trying to make an internet radio with Icecast on Google's serverless Cloud Run platform. I've put this docker image in Containter Registry and then created a Cloud Run service with default Icecast port 8000. It all seems to work when visiting Cloud Run's provided URL. Using it I can get to the default Icecast and admin pages.
The problem is trying to connect to the server with a source client (tried using mixxx and butt). I think the problem is with ports since setting the port to 8000 on mixxx gives: Socket is busy error while butt just simply doesn't connect. Setting the port to 443 on mixxx gives: Socket error while butt: connect: server answered with 411!
Tried to do the same thing with Compute Engine but just installing Icecast and not a docker image and everything works as intended. As I understand Cloud Run provides a URL for the container (https://example.app) with given port on setup (for Icecast 8000) but source client tries to connect to that URL with its provided port (http://example.app:SOURCE_CLIENT_PORT). So not sure if there's a problem with HTTPS or just need to configure the ports differently.
With Cloud Run you can expose only 1 port externally. By default it's the 8080 port but you can override this when you deploy your revision.
This port is wrapped and behind a front layer on Google Cloud infrastructure, named Google Front End, and exposed with a DNS (*.run.app) on the port 443 (HTTPS).
Thus, you can reach your service only on the exposed port via port 443 wrapping. Any other port will fail.
With Compute Engine, you don't have this limitation, and that's why you haven't issues. Simply open the correct port with firewall rules and enjoy.
I am currently working on a project where I am attempting to use MinIO with a data moving program developed by my company. This broker software only allows for devices using port 80 to successfully complete a job; however, any avid user of MinIO knows that MinIO hosts on port 9000. So my question is, is there a way to change the port on which the MinIO server is hosted? I've tried looking through the config.json file to find an address variable to assign a port number to but each of the address variables I attempted to change had no effect on the endpoint port number. For reference, I am hosting MinIO on a windows 10 virtual machine during the test phase of the project and will be moving it onto a dedicated server (also windows 10) upon successful completion of testing.
Add --address :80 when you start your minio.
You can refer to this: https://docs.min.io/docs/multi-tenant-minio-deployment-guide.html
When you start the minio server use the following command…
minio server start --address :[port you want to use]
for example…
minio server start --address :8000
So the location I have my rails server setup by default blocks all ports outbound. I need to provide a list of ports to open for my Rails server and RVM to work.
What ports I need to be opened?
rvm uses https to download ruby binaries. (so port 443). Vaguely possible I suppose that some dependencies only available over http
bundler will download gems over https where possible (port 443), although if you have any gems that are configured to be fetched from github, those may be using ssh (port 22), although it is possible to change the urls to fetcher those over https too.
You'll need to open the port from which the Rails application is running. RVM and Ruby Gems primarily depend on HTTP/HTTPS per your specification, so you'll need to have the ports 80 and 443 respectively opened for outbound requests.
Components may also be downloaded git, which uses SSH on port 22 by default. You can instead configure git to use HTTPS (443) also with the following command if for some reason you'd rather not open another port:
git config --global url."https://".insteadOf git://
By default, Rails will run on port 3000 when you launch your app with the command rails server. You can also set it to the port of your choosing with the -p flag. You'll need this port open for inbound requests.
From rails server --help:
Usage: rails server [mongrel, thin, etc] [options]
-p, --port=port Runs Rails on the specified port.
Default: 3000
If you specify that a
I try to host my ruby on rails app in my computer in Ubuntu but I cannot get it. I try to port forward from my router settings. I think I successfully forward the ports a source ports 80 - 8080 and destination port 3000. Then I start webrick in production mode. However, I could not open my app from internet by typing my external IP. How can I set my computer in proper way? Do you have any suggestions?
Thanks...
Try the following to help debug the issue:
From the same machine (you can use curl in place of wget if you'd like, as it's more powerful), make sure rails is running
$ wget http://localhost:3000
From the same machine, make sure the server is bound to an external ip address
$ ifconfig (lists the ip address a.b.c.d)
$ wget http://a.b.c.d:3000
From another machine on the same network, make sure you request the web page
$ wget http://a.b.c.d:3000
If the first step fails, rails might not be running. If the second step fails, then you might have an issue with how networking is setup, but you can try rails server -b a.b.c.d to see if that fixes it. If the last step fails, then you have an issue with your local network. Finally, if they all succeed, then the issue is either with your ISP or with your router.