V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
YUCOAT
V2EX  ›  Linux

分享一下我写的http代理程序,写得有点粗糙。勉强能用

  •  
  •   YUCOAT · Mar 21, 2013 · 4505 views
    This topic created in 4796 days ago, the information mentioned may be changed or developed.
    源代码在:https://github.com/thlgood/small-tools/tree/master/Jump2

    是在Linux平台下写的。
    当时我的想法是,我的博客所使用的虚拟主机是允许用户用ssh登录shell的,那么我可以写一个http代理程序,这样以来我就可以fq了,这样可以省下一些VPN的钱。

    结果写好之后上传到主机上之后能够正确地运行,但是浏览器无法连接http代理服务器,用nmap扫了一下,感觉应该是防火墙把端口给屏蔽了。

    该程序是用C语言写的,该版本用多线程实现并发。只支持http代理,不支持标准的sock4或者sock5代理

    我写了两个版本,另一个版本的代码在https://github.com/thlgood/small-tools/tree/master/Jump 该版本有一个bug,那就是不能访问含端口号的URL。这个版本用epoll和多线程实现的并发。
    5 replies    1970-01-01 08:00:00 +08:00
    andy12530
        1
    andy12530  
       Mar 31, 2013 via iPhone
    只支持http 不怕主机被干掉么
    楼主加油
    javaluo
        2
    javaluo  
       Mar 31, 2013 via Android
    多线程我喜欢
    foxae
        3
    foxae  
       Mar 31, 2013
    HTTP明文穿不过去,要用HTTPS。
    ivanlw
        4
    ivanlw  
       Apr 15, 2013
    楼主的多线程用pthread实现的吗
    YUCOAT
        5
    YUCOAT  
    OP
       Apr 15, 2013
    @ivanlw en
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   977 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 44ms · UTC 22:19 · PVG 06:19 · LAX 15:19 · JFK 18:19
    ♥ Do have faith in what you're doing.