Simple localhost proxy for local development - http

What is a good, lightweight http proxy I can use during development on my machine? I have to bring up two HTTP servers locally that should look as if they were one to the external user. We have a proper proxy setup for prod, but I would need something lightweight for development to test things.

Related

What are the networking requirements for reverse proxy tunneling on a self hosted vscode-server instance?

I recently moved over from coder/code-server to microsoft's implementation of a code server. Included in this is the ability to set up tunnels to the remote host, however i can't seem to get it to work. I'm using nginx to forward to the code-server service as a reverse proxy which works just fine for the most part. Since the documentation doesn't include a list of networking requirements for hosting a code-server i'd like to know if there are any ports that should be open and forwarded or any additional configuration?
I've configured nginx to forward all requests to the code-server instance, but this isn't enough to get tunnels working. I can connect to it through the domain i'm listening for.

.Net 6 API - can't get data -> ERR_CERT_AUTHORITY_INVALID

I run a .Net 6 API on my Raspberry PI. I can get data from this API using the browser “https://192.168.178.51:7001/swagger/” . Also getting data from entering the url “https://192.168.178.51:7001/api/status/” returns the expected values. So the API is working so far. But when I try to get data from my Blazor WASM App using HTTPClient I get no data. Inspect the browser shows the following message:
GET https://192.168.178.51:7001/api/Status net::ERR_CERT_AUTHORITY_INVALID
How can I fix this? Do I have to install a SSL Certificate? How to do this for a self contained API?
You will need, at minima, a self-sign certificate. Then you will need to let your browser accept a self-sign.(Advance, Proceed to ServerIp)
Now, I do not know what OS you are using in your Raspberry, but for a Beaglebone(similar to Raspberry Pi) with Debian and nginx, here is the procedure
https://www.digitalocean.com/community/tutorials/how-to-create-a-self-signed-ssl-certificate-for-nginx-on-debian-10
You will need the same kind of steps for which ever OS and webserver(Apache, nginx...Kestrel?).
Using a reverse proxy will be the solution, as described here: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-6.0
Quote from the article:
Kestrel is great for serving dynamic content from ASP.NET Core. However, the web serving capabilities aren't as feature rich as servers such as IIS, Apache, or Nginx. A reverse proxy server can offload work such as serving static content, caching requests, compressing requests, and HTTPS termination from the HTTP server.
Using a reverse proxy I can set a certificate.

is it neccesary to use nginx or apache for python web in production?

I am developing a graphql api using ariadne and fastapi and thinking of launching it on hypercorn server. I don't have to serve static files and images. So, In my case is it necessary to use nginx or apache2 with hypercorn while I am going in production.
Note:- There will be a heavy traffic on this server
If it is necessary to use apache2/nginx , how can I configure to use it with hypercorn ?
Historically apache2/nginx was recommended in front of Python servers as the Python servers could only serve a single request at a time, and apache2/nginx could buffer the requests. See for example Gunicorn's docs. This isn't the case for Hypercorn (and Gunicorn's async workers) so apache2/nginx is not required.

Running Kestrel with http/2

I need to support http/2 on my web app running inside a container and I'm having a hard time to configure Kestrel to run http/2 with my self-signed certificates.
What I want to ask is, is there a difference running Kestrel behind Nginx and handling all http/2 communication on Nginx and supporting http/2 at Kestrel level?
To summarize there are two options:
1. Run Asp.Net Core app behind Nginx and on http. Http/2 is handled by Nginx.
2. Run Asp.Net Core with http/2 support.
Which way should I prefer?
For any production environment, it is better to use a dedicated reverse proxy (like Nginx) instead of exposing the application directly. They are more specialized for this purpose and usually provide better security and performance. ASP.NET Core documentation also recommends using separate reverse proxy for these reasons https://learn.microsoft.com/en-US/aspnet/core/fundamentals/servers/kestrel?view=aspnetcore-3.1

How to reverse proxy a TFS server

We're using a TFS server 2017 update 2 in our local office.
But we need access the server at home, we tried to use nginx for build a reverse proxy to access TFS server, but failed.
Also the Apache haven't ability to do that to pass the NTLM authorization of TFS.
Do someone know how to do that?
Both nginx and Apache server can't handle NTLM authentication properly. Even if use "stream" server in nginx, it still throw exceptions at times. So the best way that I've found is to write a pure reverse proxy with socket in NodeJS.
Please try the code here: https://gist.github.com/gekowa/7fdd6fa6db51a7671de5469b3943a9da
The implementation was pretty straightforward, it just double pipe local and remote sockets, and everything is just fine.
node tcpproxy.js 8080 your_internal_server_address your_internal_port
Best choice:your_internal_port=8080

Resources