Can't connect to nodejs express app with proxy - node.js

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)

Related

502 Bad Gateway nginx/1.10.3 (Ubuntu) - Angular app down

I have an website in Angular hosted on AWS. On my local machine, the app works with npm start. However, when I ssh and update the changes I get an 502 Bad Request Error. It looks like this might be a dependency issue. Do you know know to troubleshoot this?

My Ionic app can't access my local Node server from Android emulator

I'm trying to run for the first time my React/Ionic app on an Android Emulator using Capacitor. The app should connect to my local Node server using Axios.
While my app started successfully on the emulator, all server requests failed with Msg: Error: Network Error
Here's the steps that I did:
I configured Axios to connect to http://10.0.2.2:3001 instead of localhost, but the requests still fail
I opened the url http://10.0.2.2:3001/api in the Android Emulator Chrome browser, and it succeeded in connecting to my server and returning a response
I tried adding to my capacitor.config.json file the following conf, but my app still fails
"server": {
"allowNavigation": ["10.0.2.2"]
}
Would you have other advices I should try to make my app connect to my local server? Thank you
After searching, I found the solution in another SO question :
The problem comes from the fact the my app uses http instead of https requests which Android forbids by default, starting with API level 28.
To allow http requests, I added android:usesCleartextTraffic="true" to my app's AndroidManifest.xml
Reference: https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic
if you use instances on cloud, modify host file, on linux the rute is : /etc/hosts
add this line:
localhost < ip-public-your-instance >

IceCast mount point on Azure returns 404

I am deploying a docker container running an IceCast 2 server to an Azure App Service.
If I run the container locally I can connect a source (in my case a pure-data patch) to a live.mp3 mountpoint without a problem. However, when I try to connect from the same source to the IceCast server running on Azure I get a login failed message with an Azure specific 404 error code.
login failed!
server answered : HTTP/1.1 404 Not Found
Content-Type: text/html
Server: Microsoft-IIS/10.0
Date: Thu, 02 Apr 2020 18:02:05 GMT
Connection: close
Content-Length: 2778
I can reach the IceCast web GUI over a browser without a problem (http://...azurewebsites.net/).
Does anyone know what could be wrong? I am exposing port 8000 on my IceCast container which is bound to port 80 of the Azure app service.

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.

no response from express :: npm behind OSX proxy setting

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

Resources