
之前的文稿(点击进入):网页链接
提示:通过本教程进行配置之后,可以保证稳定性,不像其他某些教程,每次需要折腾连接或者开一下加速器怎么的,本教程配置好后也不挑wifi,连接任意wifi都可以。比如在公司摸鱼可以连公司的wifi,在外面连手机热点即可,并不需要开加速器或者手机折腾root共享魔法热点等。
本篇文稿仅针对在玩软路由或者NAS、并且有魔法的小伙伴
如果你不知道为什么你在手机可以正常远程游玩,但是用ps portal无法正常连接,你在别的地方看的教程会告诉你,一定要要加速器,但是不理解为什么建议先观看GT周的视频:
【深度揭秘】PlayStation Portal在国内无法串流的分析与应对
现在我们知道了问题,我的思路是,自建代理服务器,通过代理连接不能连接的服务,直接穿透,以下为必要前提,不满足任何一项均不能实现此方案:
1、你已拥有PS5、ps portal、公网ip、并且能正常使用手机流量或者其他公网通过:PSplay或者PS remote play 连接你的ps5主机。
2、在玩软路由或者NAS。会在软路由(openwrt)或者NAS连魔法。
请仔细阅读上面的提示,如果你不会,或者没弄过前面两个玩意,建议右上角X掉。
本次(20240806更新)解决了什么,为了安全做了哪些工作:
1、因PSportal特性,只有握手才会走代理,平时是走的直连流量,所以首先对代理进行限速0.01kb/s,这样即使别人连上也没什么用(太慢了)。
2、根据抓包获取PSportal需要的请求地址,添加白名单,其他拉黑,这样即使其他用户连上了,想偷网,也不一定能连接自己想连接的网站或者其他服务。
3、限制请求端口80、443,经过测试ps portal 握手也只用这两个端口,这个也是为了更安全。
实现方法:
1、你已有openwrt。
2、openwrt已连接魔法。
3、openwrt安装squid,自己度娘搞定。
4、请先通过ssh连接openwrt,然后执行以下命令,作用:创建日志文件,并赋权:
touch /home/squid_access.log
touch /home/squid_cache.log
chown squid:squid /home/squid_access.log
chown squid:squid /home/squid_cache.log
chmod 644 /home/squid_access.log
chmod 644 /home/squid_cache.log
chmod 2775 /home/ 5、squid配置文件,建议测试的时候:delay_parameters后面的1000,都改大点,比如:10000000。 http_access deny all也可以视情况注释掉。
#代理服务监听端口
http_port 61234
# 限速 定义一个延迟池
delay_pools 1
#设置延迟池为类 2(可带宽限制)
delay_class 1 2
# 允许所有客户端访问
delay_access 1 allow all
# 设置总上行和下行带宽限制为 1000 字节/秒(即 1KB/s),每个用户1000
delay_parameters 1 1000/1000 1000/1000
# 定义允许访问的域名
acl allowed_sites dstdomain dwc.dl.playstation.net
acl allowed_sites dstdomain mobile-pushcl.np.communication.playstation.net
acl allowed_sites dstdomain m.np.playstation.com
acl allowed_sites dstdomain hk.np.stun.playstation.net
acl allowed_sites dstdomain connectivitycheck.gstatic.com
acl allowed_sites dstdomain telemetry-web.api.playstation.com
acl allowed_sites dstdomain play.googleapis.com
acl allowed_sites dstdomain www.google.com
acl allowed_sites dstdomain remoteprovisioning.googleapis.com
acl allowed_sites dstdomain remoteplay.dl.playstation.net
acl allowed_sites dstdomain ca.account.sony.com
acl allowed_sites dstdomain my.account.sony.com
acl allowed_sites dstdomain r3---sn-2x3elnez.gvt1-cn.com
acl allowed_sites dstdomain smetrics.aem.playstation.com
# 允许访问定义的域名
http_access allow allowed_sites
# 拒绝访问所有其他域名
http_access deny !allowed_sites
#设置端口白名单
#acl SSL_ports port 443
#acl Safe_ports port 443
#acl Safe_ports port 80
#acl Safe_ports port 3478
#acl CONNECT method CONNECT
# 拒绝除安全 SSL 端口之外的 CONNECT 请求
http_access deny CONNECT !SSL_ports
# 拒绝对某些不安全端口的请求
http_access deny !Safe_ports
# 拒绝其他所有客户端的连接请求
http_access deny all
# 只允许 localhost 上的 cachemgr 访问 管理员用的 不管他就是
http_access allow localhost manager
http_access deny manager
# 取消注释并调整下列内容以添加磁盘缓存目录。
cache_dir ufs /home/squid-cache 100 16 256
# Squid 用户
cache_effective_user squid
#缓存策略
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
refresh_pattern . 0 20% 4320
#
# 日志,最好仅用于调试,因为它们可能会变得非常大
#
access_log /home/squid_access.log
cache_log /home/squid_cache.log
6、搞定以后,重启squid即可:
/etc/init.d/squid restart
7、其他命令:
查看启动日志:
cat /home/squid_cache.log 查看实时连接日志:
tail -f /home/squid_access.log 检查配置文件是否修改正确:
squid -k parse