如何给autobangumi设置代理,以及如何制作一个自己的代理服务器

参考教程 懒猫微服 尝试用autobangumi下载番剧,结果报错无法访问,所以我应该是需要设置一下代理对吧?

[2024-12-06 00:37:54] ERROR     [Network] Unable to connect to https://mikanani.me/RSS/MyBangumi?token=xxxxxx Please check your network settings
[2024-12-06 00:37:54] WARNING:  [Network] Failed to get torrents: https://mikanani.me/RSS/MyBangumi?token=xxxxxx

我有一台国外的linux远程主机,网络应该没问题,但不懂如何设置,问gpt学了一下

先下载squid

sudo apt update
sudo apt install squid

配置squid文件

sudo nano /etc/squid/squid.conf

添加以下内容

acl localnet src 0.0.0.0/0
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive on

acl authenticated proxy_auth REQUIRED
http_access allow authenticated

http_access deny all
http_port 3128

然后创建账号密码

sudo apt install apache2-utils
sudo htpasswd -c /etc/squid/passwd user

重启squid

sudo systemctl restart squid

接下来我就应该可以代理到远程主机的3128端口了吧?

但是还是无法访问,报错

[2024-12-06 00:37:54] ERROR     [Network] Unable to connect to https://mikanani.me/RSS/MyBangumi?token=xxxxxx Please check your network settings
[2024-12-06 00:37:54] WARNING:  [Network] Failed to get torrents: https://mikanani.me/RSS/MyBangumi?token=xxxxxx

大佬, 有点击图里面的 “代理设置”->"启用"吗?

启用了也报错 :smiling_face_with_tear:

累了,小白折腾不动了😢,求大佬指导

这是我远程主机的squid配置文件

# 允许访问这些IP
 
acl localnet src 0.0.0.1-0.255.255.255	# RFC 1122 "this" network (LAN)
acl localnet src 10.0.0.0/8		# RFC 1918 local private network (LAN)
acl localnet src 100.64.0.0/10		# RFC 6598 shared address space (CGN)
acl localnet src 169.254.0.0/16 	# RFC 3927 link-local (directly plugged) machines
acl localnet src 172.16.0.0/12		# RFC 1918 local private network (LAN)
acl localnet src 192.168.0.0/16		# RFC 1918 local private network (LAN)
acl localnet src fc00::/7       	# RFC 4193 local private network range
acl localnet src fe80::/10      	# RFC 4291 link-local (directly plugged) machines

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	# unregistered ports
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

http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports

http_access allow localhost
http_access allow localnet



include /etc/squid/conf.d/*.conf
http_access deny all


http_port 3182

coredump_dir /var/spool/squid

refresh_pattern ^ftp:		1440	20%	10080
refresh_pattern ^gopher:	1440	0%	1440
refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
refresh_pattern .		0	20%	4320

我已启用3182端口(默认3128,我改成了3182)

我尝试在本地通过代理访问蜜柑

> curl -x http://my_vps_ip:3182 -L mikanani.me

结果报错(节选片段)

<p>Your cache administrator is <a href="mailto:webmaster?subject=CacheErrorInfo%20-%20ERR_ACCESS_DENIED&amp;body=CacheHost%3A%20was%0D%0AErrPage%3A%20ERR_ACCESS_DENIED%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2006%20Dec%202024%2005%3A27%3A34%20GMT%0D%0A%0D%0AClientIP%3A%20123.117.57.97%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2F%20HTTP%2F1.1%0AUser-Agent%3A%20curl%2F8.7.1%0D%0AAccept%3A%20*%2F*%0D%0AProxy-Connection%3A%20Keep-Alive%0D%0AHost%3A%20mikanani.me%0D%0A%0D%0A%0D%0A">webmaster</a>.</p>
<br>

squid日志显示

1733462854.849      0 123.117.57.97 TCP_DENIED/403 3843 GET http://mikanani.me/ - HIER_NONE/- text/html

按照网上教程把本地机器的ip加到配置文件里,然后重新启动squid

# 允许访问这些IP
 
acl localnet src 0.0.0.1-0.255.255.255	# RFC 1122 "this" network (LAN)
acl localnet src 123.117.57.97

再次本地通过代理访问,报错

> curl -x http://my_vps_ip:3182 -L mikanani.me
curl: (56) Recv failure: Connection reset by peer

squid日志显示

1733463163.538      0 123.117.57.97 TCP_MEM_HIT/301 1108 GET http://mikanani.me/ - HIER_NONE/- text/html
1733463164.056      1 123.117.57.97 NONE_NONE/200 0 CONNECT mikanani.me:443 - HIER_DIRECT/172.67.223.55 -

放弃了😂
用已有的Quantumult 开了http代理,也能用,就先这样凑合吧

1 个赞