Renamed SetHttpProxy to SetProxy

This commit is contained in:
sta 2014-08-07 19:43:14 +09:00
parent 22c58105b5
commit e3941f9517
3 changed files with 9 additions and 9 deletions

View File

@ -63,9 +63,6 @@ namespace Example
// For HTTP Authentication (Basic/Digest)
//ws.SetCredentials ("nobita", "password", false);
// For HTTP Proxy
//ws.SetHttpProxy ("http://localhost:3128", "nobita", "password");
// Setting Origin header
//ws.Origin = "http://echo.websocket.org";
//ws.Origin = "http://localhost:4649";
@ -74,6 +71,9 @@ namespace Example
//ws.SetCookie (new Cookie ("name", "nobita"));
//ws.SetCookie (new Cookie ("roles", "\"idiot, gunfighter\""));
// Setting Proxy
//ws.SetProxy ("http://localhost:3128", "nobita", "password");
// Connecting to the server
ws.Connect ();
//ws.ConnectAsync ();

View File

@ -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.
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
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`).

View File

@ -2124,12 +2124,12 @@ namespace WebSocketSharp
}
/// <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
/// authentication (Basic/Digest).
/// </summary>
/// <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 name="username">
/// 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"/>
/// used to authenticate.
/// </param>
public void SetHttpProxy (string url, string username, string password)
public void SetProxy (string url, string username, string password)
{
lock (_forConn) {
var msg = checkIfAvailable ("SetHttpProxy", false, false);
var msg = checkIfAvailable ("SetProxy", false, false);
if (msg == null) {
if (url.IsNullOrEmpty ()) {
_proxyUri = null;