no response from express :: npm behind OSX proxy setting - node.js

I've set up osx Proxy with username and password checked the followings:
auto proxy discovery
web proxy with ip, port, username, and pass
same for the secure web proxy
So far these are what've done: on .npmrc file
proxy http://username:pass#111.111.1.11:port
https-proxy http://username:pass#111.111.1.11:port
strict-ssl false
when I request any get from my node and express app, I get these errors
Status: 503 Service Unavailable
Header == >
Connection →keep-alive
Content-Length →3555
Content-Type →text/html
Date →Fri, 25 Nov 2016 22:22:05 GMT
Mime-Version →1.0
Server →squid/3.1.9
X-Squid-Error →ERR_CONNECT_FAIL 101
When I go to any websites it works.
When I go to whatsmyip, it shows my proxy ip
any https and http websites no issues
BUT I can't get a single request ever since changing my proxy on my osx.
Help and would you be able to explain what is going on?
Thanks in Advance

Related

Proxy error: Could not proxy request ... from localhost:3000 to http://localhost:5000/

How to fix the error below?
Proxy error: Could not proxy request /api/auth/register from localhost:3000 to http://localhost:5000/.
1 See https://nodejs.org/api/errors.html#errors_common_system_errors for more information (ECONNREFUSED).
Run backend and this error will be removed automatically.
You must have set "proxy": "http://localhost:5000/" in your package.json in your client side.
What this does is that it prefixes every request with the proxy.
So this problem will arise if your backend server is listening at port other than 5000(since your every request will be directed at http://localhost:5000/<api>)
SOLUTION:
either change the proxy to what your backend server is listening at
or
change the backend server's listening port to what the proxy is set at.

Chromium proxy only https

I use mac os & chromium 80.0.3987.0 and I have problem with proxy.
When I start for example: ./Chromium --proxy-server=123.123.123.123:8888 and open https page I have proxied IP but when I open http I have my own ip! What's wrong?
How to get proxy on both http & https and return error in other cases to prevent connecting from own IP? I use it also with puppeteer.
http://whatismyip.host/ - no proxy
https://whatismyipaddress.com/ - with proxy

Python Flask End To End Encryption Behind AWS ALB

I've a Python 3 Flask app running in an ECS cluster. The Flask app is configured to run in SSL mode. The app can't be accessed via the ALB Cname, as it generates connection refused as seen here -
curl -Il https://tek-app.example.com/health
curl: (7) Failed to connect to tek-app.example.com port 443: Connection refused
When the ALB is hit directly and ignoring the SSL cert exception, it works as seen here -
curl -Il -k https://tek-w-appli-1234.eu-west-1.elb.amazonaws.com/health
HTTP/2 200
date: Sun, 24 Feb 2019 14:49:27 GMT
content-type: text/html; charset=utf-8
content-length: 9
server: Werkzeug/0.14.1 Python/3.7.2
I understand the main recommendation is to run it behind a Nginx or Apache proxy and to set the X-Forward headers via their configs, but I feel this is over engineering the solution.
I've also tried enabling the following in the app -
from werkzeug.contrib.fixers import ProxyFix
...
app = Flask(__name__)
app.wsgi_app = ProxyFix(app.wsgi_app)
...
And this fix now produces the correct source IP's in the Cloudwatch logs, but doesn't allow connections via the ALB Cname.
Is there something simple that I'm missing here?
Reply to first answer
Thank you - the Cname is pointing to the correct ALB. I ran into a similar issue two weeks back with an Apache server, and the fix was to ensure X-Forward-Proto was in use in the Apache vhosts.conf file. So I'm thinking this may be something similar.
I did it again - while developing locally I edited my /etc/hosts file to have a local entry to play with. Then when the Flask app was pushed to the cloud and tested from the same desktop, it was referencing the local DNS entry as opposed to the public equivalent, thus the connection refused. With the local entry removed, all is now working.

Can't connect to nodejs express app with proxy

I have an node js express app generated in WebStorm, I did not change nothing, it works for me on local network at home where I don't have proxy, but at University I have to set up proxy, and there app it's not working. I set up proxy in WebStorm but still not working...
Server running in WebStorm
Proxy Settings and local ip
Error Message:
ERROR
The requested URL could not be retrieved
While trying to retrieve the URL: http://192.168.0.101:3000/
The following error was encountered:
Connection to 192.168.0.101 Failed
The system returned:
(113) No route to host
The remote host or network may be down. Please try the request again.
Your cache administrator is it-suport#ase.ro.
Generated Fri, 02 Jun 2017 12:54:28 GMT by cache.ase.ro (squid/2.7.STABLE9)

Cannot POST to express server from domain with SSL on it

I have an existing ssl certificate through LetsEncrypt for my domain. On the same server as my site I have an express app running at port :8080. Before adding the SSL to the domain I was able to make requests to http://domainname:8080.com. Now that the domain making the requests is https it obviously can't make those requests. If I instead make requests to https://domainname:8080.com, I get no response and instead get a timeout error.
I have attempted to curl -X -POST on the server manually and it returns (35) gnutls_handshake() failed: The TLS connection was non-properly terminated. If I however run the same command pointing to the non https domain it executes correctly. I also tried installing the https modules for express and pointing it to the same certs I'm using for the domain. For all my effort I cannot get this to work. What am I missing here? I want to make requests to a port on the same server that is serving my app.
Setup a reverse proxy in my nginx site config from the domain to the ip address the express server was running on. This solved all the issues I was having.

Resources