Click or drag to resize

RequestContextExtensions.SetProxy Method (IRequestContext, String, String, Nullable<Int32>, String)

Version 101.0.180
Sets the proxy server for the specified IRequestContext MUST be called on the CEF UI Thread

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 101.0.180.0 (101.0.180.0)
Syntax
public static bool SetProxy(
	this IRequestContext requestContext,
	string scheme,
	string host,
	int? port,
	out string errorMessage
)

Parameters

requestContext
Type: CefSharp.IRequestContext
request context
scheme
Type: System.String
is the protocol of the proxy server, and is one of: 'http', 'socks', 'socks4', 'socks5'. Also note that 'socks' is equivalent to 'socks5'.
host
Type: System.String
proxy host
port
Type: System.Nullable<Int32>
proxy port
errorMessage
Type: System.String
error message

Return Value

Type: Boolean
returns true if successfull, false otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IRequestContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Internally calls with preference 'proxy' and mode of 'fixed_servers'
See Also