V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dbow
V2EX  ›  程序员

分享自写的 go 语言 net/http 的 socks5 代理支持库

  •  
  •   dbow ·
    maliubiao · 2014-08-15 17:03:31 +08:00 · 4761 次点击
    这是一个创建于 3554 天前的主题,其中的信息可能已经有所发展或是发生改变。
    代码不多,net/http只支持http代理, 用了这个以后就能用http.Get配合ss取墙外的某些东西了。
    6 条回复    2014-08-15 22:33:02 +08:00
    deathscythe
        1
    deathscythe  
       2014-08-15 17:24:08 +08:00
    how to use?
    nilai
        2
    nilai  
       2014-08-15 18:39:02 +08:00
    how to use too
    dbow
        3
    dbow  
    OP
       2014-08-15 18:53:02 +08:00
    @deathscythe
    @nilai 下面有示例的,socks5_example.go. socks5.go放到源代码目录,直接import, 然后在socks5.SetProxy(url)设置ss的地址, socks5.ModifyHeader的参数是个函数,用来修改Header, socks5.UnsetProxy()取消代理, 例子应该够清楚了.
    timothyye
        4
    timothyye  
       2014-08-15 19:27:03 +08:00 via Android
    代码放到gist上吧,方便star和fork
    dbow
        5
    dbow  
    OP
       2014-08-15 19:37:31 +08:00
    @timothyye 发的是gist的地址, 结果被直接嵌入了,重发一下地址, schema://gist.github.com/maliubiao/3e2e93d765759898f4f9
    Comdex
        6
    Comdex  
       2014-08-15 22:33:02 +08:00 via Android
    好东西学习一下
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1009 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:53 · PVG 04:53 · LAX 13:53 · JFK 16:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.