Renamed SetHttpProxy to SetProxy
This commit is contained in:
parent
22c58105b5
commit
e3941f9517
@ -63,9 +63,6 @@ namespace Example
|
|||||||
// For HTTP Authentication (Basic/Digest)
|
// For HTTP Authentication (Basic/Digest)
|
||||||
//ws.SetCredentials ("nobita", "password", false);
|
//ws.SetCredentials ("nobita", "password", false);
|
||||||
|
|
||||||
// For HTTP Proxy
|
|
||||||
//ws.SetHttpProxy ("http://localhost:3128", "nobita", "password");
|
|
||||||
|
|
||||||
// Setting Origin header
|
// Setting Origin header
|
||||||
//ws.Origin = "http://echo.websocket.org";
|
//ws.Origin = "http://echo.websocket.org";
|
||||||
//ws.Origin = "http://localhost:4649";
|
//ws.Origin = "http://localhost:4649";
|
||||||
@ -74,6 +71,9 @@ namespace Example
|
|||||||
//ws.SetCookie (new Cookie ("name", "nobita"));
|
//ws.SetCookie (new Cookie ("name", "nobita"));
|
||||||
//ws.SetCookie (new Cookie ("roles", "\"idiot, gunfighter\""));
|
//ws.SetCookie (new Cookie ("roles", "\"idiot, gunfighter\""));
|
||||||
|
|
||||||
|
// Setting Proxy
|
||||||
|
//ws.SetProxy ("http://localhost:3128", "nobita", "password");
|
||||||
|
|
||||||
// Connecting to the server
|
// Connecting to the server
|
||||||
ws.Connect ();
|
ws.Connect ();
|
||||||
//ws.ConnectAsync ();
|
//ws.ConnectAsync ();
|
||||||
|
@ -548,11 +548,11 @@ Also, if you would like to get each value of the Origin header and cookies, you
|
|||||||
|
|
||||||
websocket-sharp supports to connect through the **HTTP Proxy** server.
|
websocket-sharp supports to connect through the **HTTP Proxy** server.
|
||||||
|
|
||||||
If you would like to connect to a WebSocket server through the HTTP Proxy server, you should set the proxy server URL, and if necessary, a pair of user name and password for the proxy server authentication (Basic/Digest), using the `WebSocket.SetHttpProxy (string, string, string)` method before connecting.
|
If you would like to connect to a WebSocket server through the HTTP Proxy server, you should set the proxy server URL, and if necessary, a pair of user name and password for the proxy server authentication (Basic/Digest), using the `WebSocket.SetProxy (string, string, string)` method before connecting.
|
||||||
|
|
||||||
```cs
|
```cs
|
||||||
var ws = new WebSocket ("ws://example.com");
|
var ws = new WebSocket ("ws://example.com");
|
||||||
ws.SetHttpProxy ("http://localhost:3128", "nobita", "password");
|
ws.SetProxy ("http://localhost:3128", "nobita", "password");
|
||||||
```
|
```
|
||||||
|
|
||||||
I tested this with the [Squid]. And it's necessary to disable the following configuration option in **squid.conf** (e.g. `/etc/squid/squid.conf`).
|
I tested this with the [Squid]. And it's necessary to disable the following configuration option in **squid.conf** (e.g. `/etc/squid/squid.conf`).
|
||||||
|
@ -2124,12 +2124,12 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Sets the HTTP Proxy server URL to connect through, and if necessary, a pair of
|
/// Sets an HTTP Proxy server URL to connect through, and if necessary, a pair of
|
||||||
/// <paramref name="username"/> and <paramref name="password"/> for the proxy server
|
/// <paramref name="username"/> and <paramref name="password"/> for the proxy server
|
||||||
/// authentication (Basic/Digest).
|
/// authentication (Basic/Digest).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="url">
|
/// <param name="url">
|
||||||
/// A <see cref="string"/> that represents the HTTP Proxy server URL to connect through.
|
/// A <see cref="string"/> that represents the proxy server URL to connect through.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="username">
|
/// <param name="username">
|
||||||
/// A <see cref="string"/> that represents the user name used to authenticate.
|
/// A <see cref="string"/> that represents the user name used to authenticate.
|
||||||
@ -2138,10 +2138,10 @@ namespace WebSocketSharp
|
|||||||
/// A <see cref="string"/> that represents the password for <paramref name="username"/>
|
/// A <see cref="string"/> that represents the password for <paramref name="username"/>
|
||||||
/// used to authenticate.
|
/// used to authenticate.
|
||||||
/// </param>
|
/// </param>
|
||||||
public void SetHttpProxy (string url, string username, string password)
|
public void SetProxy (string url, string username, string password)
|
||||||
{
|
{
|
||||||
lock (_forConn) {
|
lock (_forConn) {
|
||||||
var msg = checkIfAvailable ("SetHttpProxy", false, false);
|
var msg = checkIfAvailable ("SetProxy", false, false);
|
||||||
if (msg == null) {
|
if (msg == null) {
|
||||||
if (url.IsNullOrEmpty ()) {
|
if (url.IsNullOrEmpty ()) {
|
||||||
_proxyUri = null;
|
_proxyUri = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user