Tuesday 16 May 2017

Connection refused behind corporate proxy with angular 4

I am experiencing some problems when I try to connect an angular 4 app with GraphQL specifically when run behind a corporate proxy. this is my architecture:

  1. Angular 4 Web App running stand alone on port 4242 that use apolo client to connect to GraphQL
  2. GraphQL Server running on port 3200 with nodejs
  3. Reverse proxy to connect both applications on port 4200

With reverse proxy, I can get to run Angular app and graphql in the same port, then I can call GraphQL with the url localhost:4200/api/graphql

When I run the app without corporate proxy (CP) works fine, but when I run behind CP, GraphQl Server gives me the error:

POST /api/graphql 500 1212.816 ms - 263
Error: connect ECONNREFUSED 52.9.22.213:443
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)

The error is fired exactly when I subscribe my query with observable in angular:

this.myService.fnQuery().subscribe( ({data}) => {

});



via xzegga

No comments:

Post a Comment