如何让我的程序通过代理连接? [英] How do I make my program connect through a proxy?

查看:75
本文介绍了如何让我的程序通过代理连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个程序并希望它连接到代理.所以会有一个文本框,用户将输入 IP:Port.一旦他们点击一个按钮,它就会通过代理运行.此外,我表单上的网络浏览器也会通过代理.

I'm working on a program and want it to connect to a proxy. So there would be a text box and the user would input the IP:Port. Once they click on a button, it would run through the proxy. Additionally, the web browsers on my form would also go through the proxy.

我该怎么做?

推荐答案

如果您使用普通套接字,只需将套接字指向代理 ip/端口即可.如果您使用的是 winforms webbrowser 控件,我认为它会使用 Windows 中设置的任何代理设置.

if you're using normal sockets, you'd simply point the socket to the proxy ip/port. If you're using the winforms webbrowser control, i think it uses whatever proxy settings are set in windows.

这篇关于如何让我的程序通过代理连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆