[英]Connect nodeJs app to on-premise server using Secure Gateway
I'm trying to connect from a nodejs webapp to a REST api hosted on premise.我正在尝试从 nodejs webapp 连接到本地托管的 REST api。 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.
我绑定了一个安全网关实例,并在端口 80 上创建了一个目标,该目标指向运行 RHEL 6 的 SG 客户端的机器。
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?我是否必须以任何方式修改 nodejs 应用程序代码,或者 SG 应该允许我透明地访问 REST api?
Your Node.js app needs to talk to the Secure Gateway service and not the API directly.您的 Node.js 应用程序需要与 Secure Gateway 服务对话,而不是直接与 API 对话。 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.
在建立与本地 API 的连接的地方,将主机名和端口号替换为创建目标时提供的云主机名和端口号。
There is an npm module to help your app obtain that host name and port - https://www.npmjs.com/package/bluemix-secure-gateway有一个 npm 模块可以帮助您的应用程序获取该主机名和端口 - 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/还有一个例子 - https://www.ibm.com/blogs/bluemix/2015/04/reaching-enterprise-backend-bluemix-secure-gateway-via-sdk-api/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.