socksproxydetectprocedure.cs
来自「破解的飞信源代码」· CS 代码 · 共 72 行
CS
72 行
namespace Imps.Client.CommLayer.NetworkDetect
{
using Imps.Client.CommLayer.SocksSipConnection;
using System;
using System.Net.Sockets;
using System.Runtime.InteropServices;
internal class SocksProxyDetectProcedure : IDisposable
{
protected int _dstPort;
protected string _dstUrl = string.Empty;
protected string _passWord = string.Empty;
protected int _proxyPort;
protected string _proxyUrl = string.Empty;
protected string _userName = string.Empty;
protected byte[] buffer = new byte[0x100];
protected const int Buffer_Size = 0x100;
protected Socket client;
public SocksProxyDetectProcedure(string proxyUrl, int proxyPort, string userName, string passWord, string dstUrl, int dstPort)
{
this._proxyUrl = proxyUrl;
this._proxyPort = proxyPort;
this._userName = userName;
this._passWord = passWord;
this._dstUrl = dstUrl;
this._dstPort = dstPort;
this.client = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
}
public virtual bool Authenticate(out SocksMessage Msg)
{
Msg = null;
return true;
}
public virtual bool BindToServer(out SocksMessage Msg)
{
Msg = null;
return true;
}
public virtual bool Connect()
{
try
{
this.client.Connect(this._proxyUrl, this._proxyPort);
return true;
}
catch
{
return false;
}
}
public void Dispose()
{
if (this.client != null)
{
this.client.Close();
}
}
public virtual bool QueryAuthMethod(out SocksMessage Msg)
{
Msg = null;
return true;
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?