socket 创建代理

1、Squid 代理

安装

brew install squid

查看是否启动

gucaohan@MacintoshdeMacBook-Pro-3 baidu % brew services list | grep squid
squid   started         getingting ~/Library/LaunchAgents/homebrew.mxcl.squid.plist
brew services stop squid
brew services start squid

配置文件地址

/opt/homebrew/etc/squid.conf

vi $(brew --prefix)/etc/squid.conf

配置IPV6

http_port [::]:3128

https://webhostinggeeks.com/howto/how-to-configure-squid-proxy-server-for-ipv6/

验证

# https
https_proxy="http://xxx.21.xx.63:8001" curl -v https://www.baidu.com

# http
http_proxy="http://xxx.21.xx.63:8001" curl -v http://www.baidu.com

# ipv6
http_proxy="http://[xxx:da00:c0bd:xxx:1434:xxx:9947:fefd]:8001" curl -v http://www.baidu.com

http://[fe80::10ca:85de:3387:f584%en0]:8001
http_proxy="http://[fe80::10ca:85de:3387:f584%en0]:8001" curl -v http://www.baidu.com

查看

 tail -f /opt/homebrew/var/logs/access.log

Mac curl 不通

如果连接不上,确保squid所在的机器上关闭防火墙

手机不通

使用ping测试网络联通性,如果ping不通,检查网络。

ping6 2408:877e:31::7

参考文档:

squid:https://blog.csdn.net/liumiaocn/article/details/108629944
在mac上使用ipv6:https://support.apple.com/zh-cn/guide/mac-help/mchlp2499/mac
https://www.lyytaw.com/%E7%BD%91%E7%BB%9C/%E7%94%A8c%E8%AF%AD%E8%A8%80%E5%86%99%E4%B8%80%E4%B8%AAsocks5%E4%BB%A3%E7%90%86%E6%9C%8D%E5%8A%A1%E5%99%A8/#socket%E7%BC%96%E7%A8%8B%E7%9A%84%E6%95%B4%E4%BD%93%E6%B5%81%E7%A8%8B
ipv6上的%是什么意思:https://cloud.tencent.com/developer/article/1767474

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值