如何搭建代理网关?
我有很棒的 IM,需要代理类型(SOCKS4、SOCKS4A、SOCKS5)才能工作,但是我的公司正在使用 Http 代理。
我想构建自己的代理,仅将数据转发到我公司的代理(我需要输入用户名和密码才能连接到该代理)。怎么做呢?
I have great IM that to work needs proxy of type (SOCKS4,SOCKS4A,SOCKS5), However my company is using Http Proxy.
I would like to build my own proxy that will just forward data to my company's proxy(I need to enter username and password to connect to that proxy). How to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您需要代理软件,为什么要重新发明轮子呢?只需使用已经编写的内容(即 jsocks)。如果需要的话应该可以添加身份验证。
如果您的公司代理仅使用 HTTP,我怀疑简单转发是否适用于仅 SOCKS 软件。
If you need proxy software, why reinvent the wheel? Just use something that is already written (i.e. jsocks). It should be possible to add authentication if you need it.
If your company proxy is HTTP only, I doubt simple forwarding would work for SOCKS-only software.
如果公司对互联网访问有如此严格的限制,则代理可能仅配置为 HTTP(s) 网关,将没有可用的端口命令,因此如果没有自定义框关闭网络,直接互联网流量将超出范围。
自定义盒子可能是您家里安装了 DD-WRT 或 OpenWRT。您唯一需要做的就是将其 ssh 控制台设置为端口 443 (HTTPS) - 所有这些都使用漂亮的 Web 管理面板(考虑到易用性,DD-WRT 具有优势)。另一种方法是使用朋友的 linux 盒子、一些专用服务器或廉价的虚拟服务器,因为你需要的唯一功能是在端口 443 上运行 ssh 服务器。
如果你有一个 linux 盒子,在端口 22 或其他非默认端口上运行 ssh ,只需将以下行添加到/etc/init.d/local(或/etc/conf.d/local.start):
现在您需要从工作中连接到您的盒子,您可以使用瑞士军刀 - putty。 此处 是一篇很好的文章,介绍了如何绕过代理和 这里是如何在运行 putty 客户端的计算机上设置本地 SOCKS 代理的文章。合并这两篇文章即可获得预期结果 - 在从 HTTP 代理后面连接时设置 SOCKS 代理。
祝你好运,自由将会胜利。
If the company is so restrictive regarding internet access, the proxy is probably configured as HTTP(s) gateway only, there will be no port commands available so direct internet traffic is out of range without a custom box off the network.
A custom box might be your internet router at home with installed DD-WRT or OpenWRT. The only thing you need to do is to setup it's ssh console to port 443 (HTTPS) - all using nice web admin panel (DD-WRT has the edge considering ease of use). The alternative is to use a friend's linux box, some dedicated server or a cheap virtual server as the only functionality you will need is running ssh server on port 443.
If you have a linux box with ssh on port 22 or other, non-default, just add following lines to /etc/init.d/local (or /etc/conf.d/local.start):
Now you need to connect to your box from work, you can use swiss army knife - putty. Here is a nice article how to bypass proxy and here is the article how to setup local SOCKS proxy on a machine running putty client. Combine both articles to get expected result - setting up SOCKS proxy while connecting from behind a HTTP proxy.
Good luck, freedom will win.
Windows Internet 设置中是否配置了 HTTP 代理?如果是这样,您可以告诉 Java 使用系统代理,如下所示:
Is the HTTP proxy configured in the Windows internet settings? If so, you can tell Java to use the system proxy like so:
我不明白我想的问题?
您想编写一个一端有 SOCKS API、另一端有 HTTP 的 java 组件吗?您的 IM 应用程序使用什么协议?正如“mindas”所暗示的那样,您可能需要的不仅仅是简单的转发。
如果您只是搜索处理 HTTP 机制(包括代理身份验证)的 Java 软件,请选择 Apache httpcomponents http://hc.apache.org /
I don't get the question i think?
You want to write a java component that on one end has a SOCKS API, on the other HTTP? What protocol uses your IM app? As "mindas" hints, you might need much more than a simple forwarding.
If you simply search java sofwtware that handles HTTP mechanics, including Proxy authentication, go for Apache httpcomponents http://hc.apache.org/
您需要两个代理,一个位于 HTTP 代理前面,一个位于 HTTP 代理后面。只需安装一个新的 SOCKS 代理即可更轻松。
相对。
You would need two proxies, one in front of the HTTP proxy and one behind it. Easier to just install one new SOCKS proxy.
versus.