Make all http requests in Node follow machine's proxy settings - node.js

I am investigating some background Http requests made by a third party module. I want to route all such requests (I don't know where they are located) through a proxy (Fiddler) configured at the PC level so that I can inspect the payload and responses.
Is there a way to transparently make all network requests in a Node app follow the PC's proxy settings?

Related

Sending an http request from an https website

I have an https website (using LAMP stack) and I want to send an http request to port 3000 of a separate node.js server when you click a button (using an AJAX call and jsonp). It worked when my website was not secured (http), but after I switched to using a load balancer to make it secure (I'm using Amazon Lightsail), the http request no longer works. Is this because an https website does not allow http requests since all information on the website is supposed to be secure? And if so, should I send an https request instead? This would require me to make the node.js server https-secured by adding it to the load balancer. However, would this prevent me from requesting to port 3000 since load balancers only accept requests to ports 80 (http) and 443 (https)? I've looked into listeners but it seems like Amazon Lightsail does not support listeners with its load balancers.
Put that node server behind the same load balancer as a reverse proxy with another route or dns and it will probably work for you.

Does only my web server proxy need to support HTTP 2/3

I run an ExpressJS website in a docker container forwarded to a localhost port. I use NGINX to proxy and push it to the internet with caching, SSL, and all of the normal things.
I am wondering how I need to implement HTTP 2 and 3. Similar to SSL, do I only need to use it on my proxy server (NGINX), or does the whole chain need to support it?

Proxy all sentry request in node application

I have a nodeJs application which I want to use sentry in my application. I configured it properly but I want to proxy all my sentry requests. so how can I do this? can I do something like port forwarding, for example, all requests to https://XXXXX#sentry.io go through the specific machine in another host then redirect to sentry.io? how can I do that?
You can configure an HTTP(S) Proxy.
The docs on sentry.io say:
httpProxy
When set a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate https-proxy is configured. Note however that not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy if possible. For instance, on unix systems, the http_proxy environment variable will be picked up.
There's a dedicated option for https too, if you want different proxies.

how to use nginx 3rd party module when proxying connections to application servers

I developed a Nginx 3rd party dynamic module and did required configuration in nginx.conf. Able to run that module and see it doing processing. This module reads request request header, cookies etc., does some business logic execution and modify response header then send back response to client.
Problem -: "How to use nginx module when proxying connections to application servers"
I'm be using Nginx as proxy server and Tomcat or Node as application server and my application hosted on app server. I'm able to route the request through both web & app server and get response back but module isn't getting invoked. Not sure how to link/configure it so that my able to intercept request and modify response header as per need.
Flow -: Browser <-> Web Server (module sits here) <-> Application Server
Has anybody explored this part? If yes then please help.

Node express from webserver

I have been developing a standalone app for an event exhibition. This comprised of a backbonejs frontend with a node express server backend for saving data. At the event this will run over localhost fine but how can I make the express server be accessed via normal http. I.e the backend responds when app is added to my webserver for client review
Any ideas.
G
Servers available at localhost should respond to http requests if your firewall is open. If you are behind a router, you need to configure it to forward requests to your machine. NAT is the simplest (and least safe) way.

Resources