简体   繁体   English

使用 Secure Gateway 将 nodeJs 应用程序连接到本地服务器

[英]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.

相关问题 使用Web App(Express.js)中的NTLM身份验证与本地(IFD)CRM进行身份验证 - Authenticating with on-premise (IFD) CRM using NTLM authentication from Web App (Express.js) 我无法使用 docker 将 nodejs 应用程序连接到 redis 服务器 - I can't connect a nodejs app to a redis server using docker 使用NodeJS连接到SQL Server - Connect to a SQL Server using NodeJS 如何将本地DB2数据库连接到Bluemix中部署的应用程序 - How do I connect to an on-premise DB2 database to an application deployed in Bluemix 如何使用安全网络中的nodejs连接到gitHub api? - How to connect to gitHub api using nodejs from a secure network? 如何在 Docker 中将 NATS 服务器连接到 NodeJS 应用程序 - How to connect NATS server to NodeJS app in Docker 使用javascript / NodeJS连接到MS Exchange Server - Connect to MS Exchange Server using javascript/NodeJS 使用Node.js服务器中的Typescript连接到Postgresdb - Connect to postgresdb using typescript from nodejs server 无法使用NodeJ连接到Realm Object Server - Unable to connect to Realm Object Server using NodeJs 如何在OpenShift中使用NodeJS服务器连接到MySQL? - How to connect to MySQL using NodeJS server in OpenShift?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM