News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
JS SDK running on a nodejs app behind proxy
Tags: sdk
Nov 16, 2020 at 1:22pm   •   5 replies  •  0 likes
Cleiton Lenkiu

What is the right procedure to run a nodejs application with RC JS SDK behind a proxy?
I am trying to call rcsdk.platform.login() from behind a proxy, but the request never reaches the RC sandbox.

The same request works fine, when running in a box with direct access to the RC sandbox system.

5 Answers
answered on Nov 18, 2020 at 6:09pm  

@Tyler Liu,
Thanks for the answer. The code posted above has solved the proxy issue.

answered on Nov 18, 2020 at 2:27pm  

Sample code (un-tested):

const platform = rcsdk.platform;
const send = platform.send.bind(platform);
platform.send = (options) => {
    return send({...options, agent: new HttpsProxyAgent('YOUR PROXY SERVER')});

answered on Nov 18, 2020 at 9:56am  

According to

Solution is

fetch('',{ agent:new HttpsProxyAgent('')}).then(function(res){

JS SDK supports options:

Please have a try and update me. I don't have an env to verify. But I reviewed the relevant code, it should work.

answered on Nov 18, 2020 at 7:24am  

@Tyler Liu,
Yes, RingCentral server can be reach from the command line via curl.

root@umt-virtual-machine:/opt# curl -v --insecure
* Trying
* Connected to (nil) ( port 80 (#0)
* Establish HTTP proxy tunnel to
> Host:
> User-Agent: curl/7.52.1
> Proxy-Connection: Keep-Alive
< HTTP/1.1 200 Connection established
* Proxy replied OK to CONNECT request
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: OU=Domain Control Validated; CN=*
* start date: Jul 3 12:19:12 2020 GMT
* expire date: Jul 3 11:31:30 2022 GMT
* issuer: C=US; ST=Arizona; L=Scottsdale;, Inc.; OU=; CN=Go Daddy Secure Certificate Authority - G2
* SSL certificate verify ok.
> GET /restapi/v1.0 HTTP/1.1
> Host:
> User-Agent: curl/7.52.1
> Accept: */*
< HTTP/1.1 200 OK
< Server: nginx
< Date: Tue, 17 Nov 2020 17:56:40 GMT
< Content-Type: application/json;charset=utf-8
< Content-Length: 169
< Connection: keep-alive
< RCRequestId: 3eef543c-28fe-11eb-84ba-005056bb86e2
< RoutingKey: SJC11P01PAS02
< Content-Language: en
< Vary: Accept-Encoding, User-Agent
"uri" : "",
"versionString" : "1.0.44",
"releaseDate" : "2020-11-06T00:00:00.000Z",
"uriString" : "v1.0"
* Curl_http_done: called premature == 0
* Connection #0 to host (nil) left intact

But, callling sdk.platform.login() fails to reach the server when running on a nodejs app

FetchError: request to failed, reason: connect ETIMEDOUT

We've set in the server https_proxy and http_proxy environment variable as well we set npm configuration for proxy and https-proxy

It seems to me that the RC sdk doesn't take care of proxy configuration when calling the fetch request.

answered on Nov 17, 2020 at 9:26am  

I don't think there are any proxy configurations in JS SDK.

Could you please try


in your environment?

Can curl reach RingCentral server? If not, could you please configure your proxy to transparently forward HTTP traffic to ?


A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

Developer Platform
Integrated Apps
App Gallery
Developer support
Games and rewards

Resource center
Product Releases
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us