Различия
Показаны различия между двумя версиями страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
proxy:network:proxy [2023/12/13 09:45] – mirocow | proxy:network:proxy [2023/12/14 23:53] (текущий) – mirocow | ||
---|---|---|---|
Строка 1: | Строка 1: | ||
- | {{tag> | + | {{tag> |
====== Squid+Privoxy+Tor ====== | ====== Squid+Privoxy+Tor ====== | ||
Строка 9: | Строка 9: | ||
nano / | nano / | ||
< | < | ||
- | acl manager proto cache_object | + | check_hostnames off |
- | acl localhost src 127.0.0.1/ | + | |
- | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 | + | |
- | acl ftp proto FTP | + | |
- | acl localnet src 10.0.0.0/ | + | |
- | acl localnet src 172.16.0.0/ | + | |
- | acl localnet src 192.168.0.0/ | + | |
- | acl localnet src fc00::/ | + | |
- | acl localnet src fe80::/ | + | |
- | acl SSL_ports port 443 | + | acl localnet src 0.0.0.1-0.255.255.255 # |
- | acl Safe_ports port 80 | + | acl localnet src 10.0.0.0/ |
- | acl Safe_ports port 21 | + | acl localnet src 100.64.0.0/ |
- | acl Safe_ports port 443 # https | + | acl localnet src 169.254.0.0/ |
- | acl Safe_ports port 70 | + | acl localnet src 172.16.0.0/ |
- | acl Safe_ports port 210 # wais | + | acl localnet src 192.168.0.0/ |
- | acl Safe_ports port 1025-65535 | + | #acl localnet src fc00::/ |
- | acl Safe_ports port 280 # http-mgmt | + | #acl localnet src fe80::/ |
- | acl Safe_ports port 488 # gss-http | + | |
- | acl Safe_ports port 591 # filemaker | + | |
- | acl Safe_ports port 777 # multiling http | + | |
- | acl Safe_ports port 3128 | + | |
- | acl CONNECT method CONNECT | + | |
- | http_access allow manager localhost | + | ### |
- | http_access deny manager | + | acl russia_block_list url_regex "/ |
+ | acl i2p_list url_regex -i .*:// | ||
+ | acl onion_list url_regex -i .*:// | ||
- | http_access deny !Safe_ports | + | # i2p |
+ | cache_peer localhost | ||
+ | cache_peer_access localhost allow i2p_list | ||
- | http_access deny CONNECT !SSL_ports | + | # privoxy |
+ | cache_peer 192.168.1.131 parent 8118 8118 no-digest allow-miss no-query | ||
+ | cache_peer_access 192.168.1.131 allow onion_list | ||
+ | cache_peer_access 192.168.1.131 allow russia_block_list | ||
- | http_access | + | never_direct |
- | http_access | + | never_direct |
+ | never_direct allow russia_block_list | ||
+ | never_direct deny localnet | ||
- | http_port 3128 | + | always_direct deny onion_list |
+ | always_direct deny i2p_list | ||
+ | always_direct deny russia_block_list | ||
+ | always_direct allow localnet | ||
- | hierarchy_stoplist cgi-bin ? | + | http_access allow localnet |
+ | hosts_file / | ||
- | cache_peer 127.0.0.1 parent 8118 7 no-query no-digest | + | ### |
- | coredump_dir / | + | acl SSL_ports port 443 |
+ | acl Safe_ports port 80 # http | ||
+ | acl Safe_ports port 21 # ftp | ||
+ | acl Safe_ports port 443 # https | ||
+ | acl Safe_ports port 70 # gopher | ||
+ | acl Safe_ports port 210 # wais | ||
+ | acl Safe_ports port 1025-65535 # | ||
+ | acl Safe_ports port 280 # http-mgmt | ||
+ | acl Safe_ports port 488 # gss-http | ||
+ | acl Safe_ports port 591 # filemaker | ||
+ | acl Safe_ports port 777 # multiling http | ||
- | refresh_pattern ^ftp: | + | acl CONNECT method CONNECT |
- | refresh_pattern ^gopher: | + | |
- | refresh_pattern -i (/ | + | |
- | refresh_pattern . | + | |
+ | http_access deny !Safe_ports | ||
+ | http_access deny CONNECT !SSL_ports | ||
+ | http_access allow localhost manager | ||
+ | http_access deny manager | ||
- | httpd_suppress_version_string on | + | include / |
- | forwarded_for off | + | http_access |
- | always_direct | + | http_access deny all |
- | never_direct allow all | + | http_port 3128 |
- | </ | + | |
+ | coredump_dir / | ||
+ | |||
+ | refresh_pattern ^ftp: | ||
+ | refresh_pattern ^gopher: | ||
+ | refresh_pattern -i (/ | ||
+ | refresh_pattern . 0 20% 4320 | ||
+ | </ | ||
====== Privoxy ====== | ====== Privoxy ====== | ||
nano / | nano / | ||
< | < | ||
- | forward-socks4a | + | # |
+ | # https:// | ||
+ | # | ||
+ | listen-address | ||
+ | #ExitNodes {za} | ||
+ | # | ||
+ | user-manual / | ||
confdir / | confdir / | ||
logdir / | logdir / | ||
+ | actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on. | ||
actionsfile default.action | actionsfile default.action | ||
actionsfile user.action | actionsfile user.action | ||
filterfile default.filter | filterfile default.filter | ||
+ | filterfile user.filter | ||
logfile logfile | logfile logfile | ||
- | + | debug 1 # Log the destination for each request. See also debug 1024. | |
- | debug 4096 # Startup banner and warnings | + | debug 2 # show each connection status |
- | debug | + | debug 4 # show tagging-related messages |
- | + | debug 8 # show header parsing | |
- | user-manual / | + | # |
- | listen-address | + | debug 32 # debug force feature |
+ | debug 64 # debug regular expression filters | ||
+ | debug 128 # debug redirects | ||
+ | # | ||
+ | debug 512 # Common Log Format | ||
+ | debug 1024 # Log the destination for requests Privoxy didn't let through, and the reason why. | ||
+ | debug 2048 # CGI user interface | ||
+ | debug | ||
+ | debug 8192 # Non-fatal errors | ||
+ | #debug 32768 # log all data read from the network | ||
+ | #debug 65536 # Log the applying actions | ||
toggle | toggle | ||
- | enable-remote-toggle 0 | + | enable-remote-toggle |
+ | enable-remote-http-toggle | ||
enable-edit-actions 0 | enable-edit-actions 0 | ||
- | enable-remote-http-toggle | + | enforce-blocks |
buffer-limit 4096 | buffer-limit 4096 | ||
+ | enable-proxy-authentication-forwarding 0 | ||
+ | forward-socks5 / localhost: | ||
+ | forward-socks4 / localhost: | ||
+ | forward-socks4a / localhost: | ||
+ | forward-socks4a .onion localhost: | ||
+ | forward .i2p localhost: | ||
+ | forward 192.168.*.*/ | ||
+ | forward 127.*.*.*/ | ||
+ | forwarded-connect-retries | ||
+ | accept-intercepted-requests 1 # это позволит делать прозрачное проксирование через iptables | ||
+ | allow-cgi-request-crunching 0 | ||
+ | split-large-forms 0 | ||
+ | keep-alive-timeout 5 | ||
+ | tolerate-pipelining 1 | ||
+ | socket-timeout 300 | ||
</ | </ | ||
- | |||
====== Tor ====== | ====== Tor ====== | ||
Строка 94: | Строка 143: | ||
nano / | nano / | ||
< | < | ||
- | SocksPort 9050 # what port to open for local application connections | + | # |
- | SocksBindAddress 127.0.0.1 # accept connections only from localhost | + | # https:// |
- | AllowUnverifiedNodes middle,rendezvous | + | # https:// |
- | Log notice syslog | + | # curl -x socks5h:// |
+ | # | ||
+ | SocksPort | ||
+ | ControlPort localhost: | ||
+ | # | ||
+ | Log notice file / | ||
+ | Log debug file / | ||
+ | # | ||
+ | DataDirectory / | ||
+ | CookieAuthentication 0 | ||
+ | User debian-tor | ||
+ | Group debian-tor | ||
+ | RunAsDaemon 1 | ||
+ | # Эти настройки немного ускоряют работу - важно для слабых устройств | ||
+ | CircuitBuildTimeout 30 | ||
+ | KeepAlivePeriod 60 | ||
+ | NewCircuitPeriod 15 | ||
+ | NumEntryGuards 8 | ||
+ | # Это позволяет ограничить количество используемых сокетов - важно при работе на опять-таки " | ||
+ | ConstrainedSockets 1 | ||
+ | # Мининизировать запись на диск - это важно для устройств, | ||
+ | AvoidDiskWrites 1 | ||
+ | |||
+ | # bridges | ||
+ | ClientTransportPlugin obfs4 exec / | ||
+ | Bridge obfs4 [2400: | ||
+ | Bridge webtunnel [2001: | ||
+ | Bridge webtunnel [2001: | ||
+ | Bridge obfs4 185.177.207.137: | ||
+ | Bridge obfs4 207.172.185.193: | ||
+ | UseBridges 1 | ||
+ | </ | ||
+ | |||
+ | ====== Bridges ====== | ||
+ | |||
+ | * <code bash>$ apt install obfs4proxy</ | ||
+ | * https:// | ||
+ | |||
+ | ===== RKN ===== | ||
+ | |||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | curl -fsSL https:// | ||
+ | | sed 1d \ | ||
+ | | cut -d ';' | ||
+ | | tr " | ||
+ | | sed 's/^[ \t]*//;s/[ \t]*$//' | ||
+ | | uniq > / | ||
+ | |||
+ | #“sed 1d” — отрезаем первую строку | ||
+ | #“cut -d ';' | ||
+ | #tr " | ||
+ | #sed 's/^[ \t]*//;s/[ \t]*$//' | ||
+ | #uniq — удаляем дублирующиеся строки. | ||
</ | </ |