折腾了几天 tsocks?

2020-03-23 10:00:37 +08:00
 gatusokaka
一直没通,下面是 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
4092 次点击
所在节点    Linux
16 条回复
chuankoog
2020-03-23 10:52:11 +08:00
sl0000
2020-03-23 11:09:26 +08:00
配置 apt 的 proxy?
gatusokaka
2020-03-23 12:40:38 +08:00
@sl0000 对的
felix021
2020-03-23 12:44:42 +08:00
最后 5 行不就是 IP 和端口吗? RTFM
sl0000
2020-03-23 14:11:09 +08:00
@gatusokaka 记得当时我用这个解决了 "Acquire::http::proxy "socks5h://server:port";"
sarvatathagata
2020-03-23 15:21:45 +08:00
原理是修改环境变量 LD_PRELOAD,使用自己的.so 覆盖掉系统自带的 connect 函数,所以不能用在 setuid 的程序等等情况下
gatusokaka
2020-03-23 15:25:53 +08:00
@sl0000 你这种改法,还需要调用 tsocks 吗?
sl0000
2020-03-23 17:04:36 +08:00
@gatusokaka 不需要, 用的 socks5
imn1
2020-03-23 17:16:57 +08:00
tsocks 印象中不能用在 apt,不过我试过一次不行就没再试(因为 tsocks 用在其他软件正常)
我是用这种

------------
sudo nano /etc/apt/apt.conf

添加下列内容

Acquire {
   http::proxy “http://user:pass@yourProxyAddress:port”
  }
gatusokaka
2020-03-23 17:33:56 +08:00
@imn1 我路径下 /etc/apt/有一个 apt.conf.d 文件夹,apt.conf 需要在这个文件夹里创建吗?
gatusokaka
2020-03-23 17:34:11 +08:00
@sl0000 好的,我试试
imn1
2020-03-23 18:15:08 +08:00
@gatusokaka #10
不是,就在 apt 那层,我现在没开 linux 机器,看不了
gatusokaka
2020-03-23 18:45:55 +08:00
@imn1 ok
gatusokaka
2020-03-23 21:16:10 +08:00
@imn1 这个表达式的值哪些需要替换成真实值?
gatusokaka
2020-03-23 21:21:29 +08:00
@sl0000 "Acquire::http::proxy "socks5h://server:port";"里面的 server 和 port 得用真实值替换吧?
skies457
2020-03-24 11:22:11 +08:00
proxychains4-ng 比较好用一点

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/655253

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX