简体   繁体   English

我如何在Webkit-Sharp iMonoDevelop中使用代理

[英]How do I use proxy in webkit-sharp i nMonoDevelop

I want to know how I can detect if the network the computer is connected to has proxy, and if it does then I want to be able to get the proxy address and the port of the network and use it in the web browser. 我想知道如何检测计算机所连接的网络是否具有代理,如果可以,那么我希望能够获取代理地址和网络端口并在Web浏览器中使用它。

I know this cannot be done through the webkit's properties, and some DLLs need to be imported. 我知道这无法通过Webkit的属性完成,并且需要导入某些DLL。 So, this is what I have so far: 所以,这就是我到目前为止所拥有的:

[DllImport("webkit-1.0")]
static extern IntPtr webkit_get_default_session();

[DllImport("soup-2.4")]
static extern IntPtr soup_uri_new(string uri);

[DllImport("gobject-2.0")]
static extern void g_object_set(IntPtr obj, string name, IntPtr value, IntPtr zero);

As you can see, I have imported the DLLs needed, but I don't know what to do next. 如您所见,我已经导入了所需的DLL,但是我不知道下一步该怎么做。

I really need help with this. 我真的需要帮助。 If someone can give me a link or give me some codes that can fulfill the requirements that I have stated in the beginning then please give it to me. 如果有人可以给我一个链接或给我一些可以满足我一开始就说过的要求的代码,请给我。

Thanks a lot. 非常感谢。

WebKit is not something you use to connect to the internet, AFAIK its a rendering engine. WebKit不是您用来连接到Internet的东西,AFAIK是您的渲染引擎。
Underlying it would be using Sockets to connect to the internet. 它的底层将是使用套接字连接到互联网。
For .NET search msdn for HttpWebRequest to learn how the request object makes use of proxies for making the request. 对于.NET,请在msdn中搜索HttpWebRequest以了解请求对象如何利用代理进行请求。

Also if the computer your software is configured to run via proxy in Internet Options, any requests your application makes will also be via the proxy. 同样,如果您的软件配置为通过Internet Options中的代理运行,则您的应用程序发出的任何请求也将通过代理进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM