mitmproxy: Error starting proxy server: OSError(98, ‘Address already in use’)

I just installed mitmproxy tool. I want to run it. Once I type: sudo mitmproxy I get this error:

Error starting proxy server: OSError(98, ‘Address already in use’)

I searched and found some suggestion for changing the port by typing: sudo mitmproxy -p 99999 However, I think this may cause me problems as I wan to do HTTPS traffic manipulation.

Can you please help me solve the error?

Route incoming OpenVPN (TCP) Traffic to local tor proxy with ufw

I have a OpenVPN running on my Ubuntu (18) Server and a tor proxy. OpenVPN is running on TCP Port 443 (to bypass strict firewalls). Tor is running internally as proxy on port 9050. I would like to route every traffic which is coming from OpenVPN through tor.

I have following ufw rules:

*nat :POSTROUTING ACCEPT [0:0] -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE COMMIT 

I would like to do that with ufw (if possible). As far as I know ufw works on the same way like iptables. So it should be possible with ufw?

My second question would be about DNS. Currently my OpenVPN does NOT push any DNS server. How does DNS works when I connect via OpenVPN and the server does not push any dns? It is possible to do DNS also over (openvpn and) tor?

How to install Docker Ubuntu 18.04 with https proxy error

I have an issue of installing Docker on ubuntu 18.04

When I try the following lines I get an https error due to there being no http version and we are behind a company proxy so it fails.

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"  sudo apt update 

Fails with.

Certificate verification failed: The certificate is NOT trusted. The certificate issuer is unknown.  Could not handshake: Error in the certificate verification. 

Is there an alternative way to install even for a one of version using curl or wget?

Is there a way of bypassing a proxy in the apt conf to tell it to ignore the certificate error?

Search page not showing after URL rewrite on reverse proxy

Our SharePoint 2016 on-premise farm have setup Internet access. Our reverse proxy have setup URL rewrite from ‘https://www.mysharepoint.com’ (Internet URL) to https://server_wfe1/ (our web front end server).

Most functions are working fine beside the search page. When browse with IE nothing wrong. But browse with Chrome or Firefox return:

Unexpected response from server. The status code of response is ‘403’. The status text of response is ‘Forbidden’.

After checking ULS log, the problem is:

Request is a Cross-Origin request. Origin is : ‘https://www.mysharepoint.com’. Host is : https://server_wfe1/_vti_bin/client.svc/ProcessQuery

How can we configure SharePoint to work around it?

Varnish with NGINX SSL proxy 502 error

I am trying to setup an nginx backend with Varnish and magento 2.3.2. To do that the flow would be: Port 80 is forwaded to 443. 443 proxypass to Varnish Listener on 8080.

Here is the nginx config for port 80:

upstream fastcgi_backend { # Socket path   server unix:/run/php/php7.2-fpm.sock; }  server {     listen 80;     server_name magento-test.example.com;      location ^~ /.well-known/acme-challenge/ {       allow all;       root /var/lib/letsencrypt/;       default_type "text/plain";       try_files $  uri =404;     }     return 301 https://magento-test.example.com$  request_uri; } 

Then the listener on port 443 with proxypass:

server {     listen 443 ssl http2;     server_name magento-test.example.com;      ssl_certificate ...     ssl_certificate_key ...     ssl_trusted_certificate ...     ssl_dhparam /etc/ssl/certs/dhparam.pem;      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;     ssl_ciphers 'AES128+EECDH:AES128+EDH:!aNULL';     ssl_session_cache shared:SSL:10m;     ssl_session_timeout 24h;     keepalive_timeout 300s;      location / {         proxy_pass http://127.0.0.1;         proxy_set_header Host $  http_host;         proxy_set_header X-Forwarded-Host $  http_host;         proxy_set_header X-Real-IP $  remote_addr;         proxy_set_header X-Forwarded-For $  proxy_add_x_forwarded_for;         proxy_set_header Ssl-Offloaded "1";         proxy_set_header X-Forwarded-Proto https;         proxy_set_header X-Forwarded-Port 443;         #proxy_hide_header X-Varnish;         #proxy_hide_header Via;         proxy_set_header X-Forwarded-Proto $  scheme;  }  } 

And finally the listener on port 8080:

server {   server_name magento-test.example.com;   listen 8080;   set $  MAGE_ROOT /var/www/magento-test.example.com;   set $  MAGE_MODE production; # or developer     include /var/www/magento-test.example.com/nginx.conf.sample; } 

My varnish is configured the following way:

DAEMON_OPTS=" -a :6081 \                -T localhost:6082 \                -f /etc/varnish/default.vcl \                -S /etc/varnish/secret \                -p feature=+esi_ignore_other_elements \                -p cli_buffer=16384 \                -p vcc_allow_inline_c=on \                -s malloc,256m" 

And

backend default {     .host = "127.0.0.1";     .port = "8080";     .first_byte_timeout = 300s; } 

Now i get a 502 error and in the logs I can see the following error:

*35 connect() failed (111: Connection refused) while connecting to upstream, client: xx.xx.xx.xx

If I put the IP in a browser that directs me to a Linksys page (which is what my home router is…)

I tried to remove 127.0.0.1 localhost in the hosts file but still get the same result.

Any idea ?

How to solve the error with the proxy in React when working with Node?

From time to time when saving a project such an error occurs (this example actually occurs with different links):

Proxy error: Could not proxy request /api/games/handle/:handle from localhost:3000 to http://127.0.0.1:5000.

I have the following project structure:

- client -- package.json - server - package.json

Google prompted the decision to add the following under client / package.json:

"proxy": {     "/api": {       "target": "https://127.0.0.1:5000",       "secure": false     }   }, 

But it does not help, the problem still arises from time to time

Ubuntu server changing proxy

I am working on project in ubuntu server and I have to change my proxy in every 20 minutes. If I don’t my project gives me error. So I tried proxychain but I have a problem. Proxychain changing proxy in every connection and it takes time. Do you know any solution for this? Just to be clear I want to change my proxy every 20 minutes or 100 connection request. (My project written with python)