技术解析

折腾了几天 tsocks?
0
2021-06-17 17:16:29
idczone
一直没通,下面是 tsocks_config,到底为什么没通?
大家还有什么推荐的代理工具,还有就是这类工具是什么原理,感觉配置文件中也没看见配置代理服务器 IP 什么的?


# Local networks
# For this example this machine can directly access 192.168.0.0/255.255.255.0
# (192.168.0.*) and 10.0.0.0/255.0.0.0 (10.*)

local = 192.168.0.0/255.255.255.0
local = 10.0.0.0/255.0.0.0

# Paths
# For this example this machine needs to access 150.0.0.0/255.255.0.0 as
# well as port 80 on the network 150.1.0.0/255.255.0.0 through
# the socks 5 server at 10.1.7.25 (if this machines hostname was
# "socks.hello.com" we could also specify that, unless --disable-hostnames
# was specified to ./configure).

path {
reaches = 150.0.0.0/255.255.0.0
reaches = 150.1.0.0:80/255.255.0.0
server = 10.1.7.25
server_type = 5
default_user = delius
default_pass = hello
}

# Default server
# For connections that aren't to the local subnets or to 150.0.0.0/255.255.0.0
# the server at 192.168.0.1 should be used (again, hostnames could be used
# too, see note above)

server = 127.0.0.1
# Server type defaults to 4 so we need to specify it as 5 for this one
server_type = 5
# The port defaults to 1080 but I've stated it here for clarity
server_port = 1080
新鲜出炉: https://www.tiaoxingyubolang.com/zh/article/2020-03-22_procurator1

配置 apt 的 proxy?

对的

最后 5 行不就是 IP 和端口吗? RTFM

记得当时我用这个解决了 "Acquire::http::proxy "socks5h://server:port";"

原理是修改环境变量 LD_PRELOAD,使用自己的.so 覆盖掉系统自带的 connect 函数,所以不能用在 setuid 的程序等等情况下

你这种改法,还需要调用 tsocks 吗?

不需要, 用的 socks5

tsocks 印象中不能用在 apt,不过我试过一次不行就没再试(因为 tsocks 用在其他软件正常)
我是用这种
------------
sudo nano /etc/apt/apt.conf
添加下列内容
Acquire {
   http::proxy “http://user:[email&/>  }

我路径下 /etc/apt/有一个 apt.conf.d 文件夹,apt.conf 需要在这个文件夹里创建吗?

好的,我试试

/>不是,就在 apt 那层,我现在没开 linux 机器,看不了

ok

这个表达式的值哪些需要替换成真实值?

"Acquire::http::proxy "socks5h://server:port";"里面的 server 和 port 得用真实值替换吧?

proxychains4-ng 比较好用一点

数据地带为您的网站提供全球顶级IDC资源
在线咨询
专属客服