Access an AngularJS app running on a Grunt-Proxy server inside a VM from the host - proxy

In our development environment we have Ubuntu VMs running on a Windows 7 host. We found that if we change the Gruntfile's "connect.options.hostname" to '0.0.0.0' we can hit our Angular app running in the VM from Internet Explorer in the host.
In order to avoid a cross-domain error when we hit some web services from Angular, we setup a Grunt-Proxy server. This works fine in the VM. From the host, any time the app tries to hit a web service it fails (since it's not on the proxy port) trying to access a server on port 9000 (the server is running on port 8888). From the host when I try to access the App on the proxy port (8050) I just get a 404 error - I'm not really sure how to proceed with this.
My proxy is setup as follows in the Gruntfile:
proxy: {
proxy1: {
options: {
port : 8050,
host : 'localhost',
router : {
'localhost/rest/*' : 'localhost:8888',
'localhost' : 'localhost:9000'
}
}
}
},
I tried playing with some of these settings but haven't had any luck. Any help would be appreciated.

Related

How can I setup my nextjs app to run on EC2 as it's only running on localhost?

I would like to make my nextjs app run on an EC2 instance (ubuntu 18.04).
However, when I sudo npm start, it's then running on localhost, and I don't know how to make it accessible from outside. I tried to access the IP given by AWS and to add the port (:3000), without success.
Would you have an idea of how I must setup this app to be accessible ? What did I miss ?
Finally found out
Localhost is not the problem, it was that the ports are not open by default on EC2 instances.
By adding a Security Group and opening the ports I needed (http for 80, https 443, ssh with 22, and 3000 for the test) it worked out.

Cannot access localhost:8080 from laravel

I have a PHP application running on homestead box. This application makes calls to another app that is running on glassfish on my localhost:8080.
When PHP application sends the request to localhost:8080, I am getting following error:
ConnectException in RequestException.php line 49:
cURL error 7: Failed to connect to localhost port 8080: Connection refused
Still I can make calls to localhost:8080 from web browser.Anyone has any suggestion?
Seeing how your application is running in Homestead (which by default is available on 192.168.10.10 and is forwarded to also be accessible on localhost:8000) your application running on Glassfish will not have access to it using localhost:8080. This is because localhost in your vagrant box (Homestead) is not actually the same localhost as on the host machine.
What you could do is grab the ip address from the host machine and connect to it from your application running in Homestead.
So here is how I could solve the problem. Vagrant is the guest machine running on my localhost as host machine. To access host from guest, you need to use gateway from VB.
I found this answer which helped me to access my application on localhost.

Access web server over https in a Docker container

I'm using Boot2Docker to manage Docker containers in Windows and I have a container running an IBM Liberty server (I guess is the same for any other server), I can access the server home screen in the host machine using only the ip (which I get using the command boot2docker ip), but if I try to access the server using the https port, like this xx.xx.xx.xx:9443 the connection fails.
I tried forwarding the port in VirtualBox like this:
And then access the server using the ports 1000 or 1001, but it fails too.
Am I missing something?
BTW, I'm using default NAT connection.
https uses port 443 (not 9443) by default.
Make both "Host Port" and "Guest Port" 443 and try again.

Problems accessing grunt live server (mac) from mobile device

The server works fine locally, but I can't access the server from outside when I'm entering the hostname in my mobile browser (webpage not available). I my Gruntfile.js i have
connect: {
options: {
port: 9000,
hostname: '130.236.124.57',
livereload: 35729
},//...
where hostname is the ip (inet) adress I get when I'm running ifconfig in the terminal.
You should change your hostname to 0.0.0.0 to allow external requests and restart your grunt server.
Next, access your external server with your machine specific hostname/IP

Sonar can be accessed locally but not accessed elsewhere

Just tried to install a standalone sonar 2.0.5 in Win XP.
Setting :
IP : 127.0.0.1
Port : 9000
WebContext : /
It can be accessed locally. However when I tried to access it from other computer, it cant be accessed. So I tried to change the setting to Port 8080 ( my tomcat port ) and shutdown my tomcat. Still not accessible. My Tomcat ( port 8080, if running ) is accessible via network. Windows firewall is off.
Any idea why this happens?
You've configured Sonar to bind to the local loopback address. Try changing the IP address to "0.0.0.0".
See the following for more details:
Difference between 0.0.0.0 and 127.0.0.1

Resources