问题
I have hosted an application on JBoss on my local machine and I can access by localhost or over my IP also.
Now I want the same application to be accessed by other users over the internet by my IP.
Could you let me know how to configure my JBoss to server these requests?
回答1:
You could start your JBoss server with this param -b to bind to a specific IP:
run.bat -b <IP>
For example if you adapter is configured with the IP 192.168.0.1 use the following command to bind your JBoss server to this adapter and listen on this interface:
run.bat -b 192.168.0.1
You can use 0.0.0.0 to bind to all available interfaces, too.
Because of security reasons JBoss binds only to localhost (127.0.0.1) by default.
If your computer is not directly connected with the internet you should check your router configuration and do a port forwarding to your JBoss machine for the required ports (e.g. 80 or 8080 for http).
It is much easier to find out your IP if you use a dynamic dns redirection service (like dyndns or dtdns). Most routers supports those kind of services and the are easy to use. Just register your external (internet) reachable name and setup your router to use it.
See http://www.dyndns.com/ for example. Most of the services are free to use and there are many providers for services like this (just google for "dynamic dns ip").
回答2:
http://showoff.io is the easiest way to access localhost over the web. It requires ruby
and ruby gem
'showoff-io'.
$ gem install showoff-io
Map the instance of your website to a localhost port i.e., localhost:9090
. Then run:
$ show 9090
Or simply follow the instructions shown on showoff.io website.
UPDATE: showoff.io
is now known as forward
回答3:
http://no-ip.com You are going to set up a domain with you IP, and you are also going to have to configure the network to allow access.
回答4:
http://ngrok.com provides a free script you can use with paid features. Site is a little bare, but I downloaded the script for free and got a tunnel working.
The domains they give aren't friendly though. Mine was of the regex: http://[0-9a-z]*.ngrok.com
回答5:
http://localhost.run/ is another free way to get localhost on the internet. If you have SSH installed already you don't need to download a client to use it.
来源:https://stackoverflow.com/questions/4579939/how-to-make-my-localhost-available-over-internet