edgd1er / nordlynx-proxy

use nordvpn app to open a vpn connection, run a socks proxy
17 stars 8 forks source link

tinyproxy configuration help #23

Closed julzKB closed 1 year ago

julzKB commented 1 year ago

Hi there,

I was wondering if I could get your help with the tinyproxy config , I can't seem to connect to the proxy ( let alone use it )?


I have configured this:

LOCAL_NETWORK=192.168.0.0/24

but as far I know that's the only place I can configure it .

Here is the error I'm getting :

Screenshot 2023-04-03 at 4 59 56 PM

I'm basically wondering where I can configure it ?

Here is my docker compose ( through Portainer )

version: '3.8'
services:
  proxy:
    image: edgd1er/nordlynx-proxy:latest
    ports:
      - "1080:1080"
      - "8888:8888"
    sysctls:
      - net.ipv6.conf.all.disable_ipv6=1 # disable ipv6
    cap_add:
      - NET_ADMIN               # Required
    environment:
      - TZ=Asia/Tokyo
      - GROUP=P2P #Africa_The_Middle_East_And_India, Asia_Pacific, Europe, Onion_Over_VPN, P2P, Standard_VPN_Servers, The_Americas
      - DEBUG=0 #(0/1) activate debug mode for scripts, dante, tinproxy
      - LOCAL_NETWORK=192.168.0.0/24
      - TINYLOGLEVEL=error #Optional, default error: Critical (least verbose), Error, Warning, Notice, Connect (to log connections without Info's noise), Info
      - TINYPORT=8888 #define tinyport inside the container, optional, 8888 by default,
    secrets:
      - NORDVPN_CREDS

secrets:
    NORDVPN_CREDS:
       name: nordvpn_creds
       external: true

Here are the container logs

Status: Connected
Hostname: ch333.nordvpn.com
IP: 195.216.219.155
Country: Switzerland

City: Zurich
Current technology: NORDLYNX
Current protocol: UDP
Transfer: 92 B received, 180 B sent
Uptime: 0 seconds
2023-04-03 14:12:01: INFO: detected WAN IP: "195.216.219.87" / nordvpn status: 195.216.219.155 = 
2023-04-03 14:12:01: INFO: DANTE: generate configuration
2023-04-03 14:12:01: INFO: DANTE: INTERFACE: nordlynx, error log: /dev/stdout, log level: error, dante debug: 0
2023-04-03 14:12:01: INFO: DANTE: check configuration socks proxy
2023-04-03 14:12:01: INFO: TINYPROXY: generate configuration
2023-04-03 14:12:01: INFO: TINYPROXY: set configuration INT_IP: 10.255.0.35/ EXT_IP: 10.5.0.2
2023-04-03 14:12:01: INFO: DANTE: starting
2023-04-03 14:12:01,720 INFO spawned: 'dante' with pid 1063
2023-04-03 14:12:01,720 INFO success: dante entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
dante: started
Apr  3 14:12:03 (1680495123.559034) danted[1063]: info: Dante/server[1/2] v1.4.2 running
Apr  3 14:12:03 (1680495123.559033) danted[1066]: info: Dante/server[2/2] v1.4.2 running
2023-04-03 14:12:03: INFO: TINYPROXY: starting
2023-04-03 14:12:03,968 INFO spawned: 'tinyproxy' with pid 1105
2023-04-03 14:12:08,976 INFO success: tinyproxy entered RUNNING state, process has stayed up for > than 5 seconds (startsecs)
tinyproxy: started
2023-04-03 14:12:09,020 INFO exited: start_vpn (exit status 0; expected)
2023/04/03 14:41:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 14:56:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 15:11:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 15:26:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 15:41:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 15:56:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 16:11:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 16:26:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 16:41:28 quic transport needs reconnect, err: Application error 0x100 (remote)
2023/04/03 16:56:28 quic transport needs reconnect, err: Application error 0x100 (remote)

I would appreciate any help :)

edgd1er commented 1 year ago

Hi,

I see nothing wrong in your configuration, provided your local network is in 192.168.0.0 range. I use foxyproxy to set different proxy according to domain names, but firefox can use a proxy without any extension.

https://support.mozilla.org/en-US/kb/connection-settings-firefox

what url did you set to have the tiny proxy error.

julzKB commented 1 year ago

yeah , can't find anything weird either, unless it's something to do with the network settings in Portainer .

I just navigate to http://192.168.0.100:8888 to get the error, or when I define a proxy in the Firefox settings , like this

Screenshot 2023-04-04 at 8 32 16 AM

I get the same error: "The proxy server is refusing connections"

edgd1er commented 1 year ago

you may try the socks proxy that is embedded in the container ( port 1080) to check whether the problem is only with tinyproxy or not. you may also enter into the console through portainer or use docker compose exec lynx bash when in container, useful aliases are defined:

root@723b24ebe363:/app# alias
alias checkhttp='curl -sm 10 -x http://${HOSTNAME}:${WEBPROXY_PORT:-8888} "https://ifconfig.me/ip"'
alias checkip='curl -sm 10 "https://zx2c4.com/ip"'
alias checksocks='curl -sm10 -x socks5://${HOSTNAME}:1080 "https://ifconfig.me/ip"'
alias checkvpn='curl -sm 10 "https://api.nordvpn.com/vpn/check/full" | jq -r .status'
alias getcheck='curl -sm 10 "https://api.nordvpn.com/vpn/check/full" | jq . '
alias getdante='grep -vP "(^$|^#)" /etc/dante.conf'
alias gettiny='grep -vP "(^$|^#)" /etc/tinyproxy/tinyproxy.conf'

checkhttp will get your external ip using tinyproxy and the vpn. your ip should be the same as the one given by getcheck

root@723b24ebe363:/app# checkhttp
xxx.yyy.9.190
root@723b24ebe363:/app# getcheck 
{
  "ip": "xxx.yyy.9.190",
  "isp": "Clouvider Limited",
  "status": "Unprotected",
  "country": "Germany",
  "code": "DE"
}

gettiny will show tinyproxy's configuration and you should see:

...
Allow 127.0.0.1
Allow 192.168.0.0/24
Allow 172.21.0.0/16
.....

you have three env vars to enable verbose logging, DEBUG, TINYLOGLEVEL and DANTE_LOGLEVEL and DANTE_DEBUG. I would set DEBUG=true, the logs will be very verbose but you will have all details about what is going on.

julzKB commented 1 year ago

very nice, I appreciate the help . I'll dig in, probably something to do with my config