📄 socksproxydetectprocedure.cs
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -