I'm trying to connect from a nodejs webapp to a REST api hosted on premise. I bounded a Secure Gateway instance and created a destination on port 80 to the machine where the SG client for RHEL 6 is running.
The request is still throwing a Timeout exception.
Do I have to modify the nodejs application code in any way or the SG should allow me to access the REST api transparently?
Your Node.js app needs to talk to the Secure Gateway service and not the API directly. Where you establish a connection to your on-premise API, replace the host name and port number with the cloud host name and port number that you were given when you created the destination.
There is an npm module to help your app obtain that host name and port - https://www.npmjs.com/package/bluemix-secure-gateway
And an example - https://www.ibm.com/blogs/bluemix/2015/04/reaching-enterprise-backend-bluemix-secure-gateway-via-sdk-api/
Related
I have an Azure app service and in some cases I need to send a web request to a non-azure webserver. What do I need to do to make it possible.
Currently the web request fails with no clear error message.
In response to a HttpClient Put request I get a System.Net.WebException exception which says there were errors.
THe same request works from a desktop application.
If your webserver is reachable from the internet you should be able to access it through your App Service. Try to log a ping to your webserver and google (8.8.8.8).
If your App Service is in a VNET you should enable some outbound rules to your webservers IP adress.
The server I am connecting to is an other Azure service. After some more investigating, It appears that I can connect to it if I do not use SSL (i.e. http://) but the connection is immediately closed when using SSL (https://). I assume that the problem must be related to the use of SSL.
Can anyone please tell me about how to connect REST based services on Heroku to a Linux based Remote SQL?
I'm new to hosting REST based services. I've created some REST services via Node.js and Express and I'm trying to connect those services with a remote SQL database on my hosting plan on https://ecowebhosting.co.uk.
But it always shows server closed the connection because it requires an IP address to setup a connection between server and heroku.
In my Amazon EC2 instance I have a Pyramid server as well as a NodeJS server running. The NodeJS server acts as the frontend and I updated my security groups so I can use the public DNS to view the page.
The Pyramid server acts as a backend and the frontend accesses it by http://0.0.0.0:8002/. But when I do an http call to the backend I get a Failed to load resource: net::ERR_ADDRESS_INVALID error message.
Do I need to add a rule to the security groups, or update the iptables, or something?
If both of these services are running on the same server, you shouldn't be sending network traffic out of the server and back, so security groups will not be an issue here.
The question is, why are you using 0.0.0.0 here? I think you probably configured the Pyramid server to listen on 0.0.0.0, which really means "listen on all IP addresses". However you need to be using http://127.0.0.1:8002/ or http://localhost:8002/ in order to connect to the service from another service running on the same server.
I have created an Azure Web App with Hybrid Connection to access Web API on the on-premises machine. When I access the Web API deployed on my local machine (where Hybrid Connection Manager is installed) and connect to it using Hybrid Connection with server/port as MyMachineName/80, it works perfectly fine.
However, when I try to access the Web API on another server that my local machine is connected to over VNET, it doesn't work. In Hybrid Connection I am giving server/port as VNETMachine/5000.
The error that I am getting is:
An attempt was made to access a socket in a way forbidden by its access permissions xx.xx.xx.xx:5000
I ran netstat -o and found there is no application using this port and from my local machine where Hybrid Connection Manager is installed, I can access the Web API directly by simply typing in the URL in the browser like
http://VNETMachine:5000/api/author.
I deployed a web API at port 8090 on an on-prem server. Created a hybrid connection to on-prem server using port 8090. Status is connected. I deployed an Angular application as a Web App to Azure but AJAX request fails with "Name not resolved".
You need to use the fully qualified name of the server your application is hosted on, e.g. http://server.contoso.com/myservice rather than http://server/myservice as you would do locally.