Example #1
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="Client">クライアントのソケット</param>
 public ProxyServer(Socket Client, EndRequestDelegateMethod CallBackDelegateMethod, ICollection<string> Bans, UpperProxy Up)
 {
     this.ClientSocket = Client;
     this.Request = new RequestInfo();
     this.CallBack = CallBackDelegateMethod;
     this.BanHostName = Bans;
     this.UP = new UpperProxy(Up.IPAdress, Up.Port);
     if (UP.IPAdress != "") UpperProxyFlg = true;
 }
Example #2
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="Up">上位プロキシ</param>
 /// <param name="Pst">パスコード系</param>
 /// <param name="Pss">パスコード系</param>
 public SettingState(UpperProxy Up,bool Pst,bool Pss)
 {
     Ups = Up;
     PassStatus = Pst;
     PassSet = Pss;
 }
Example #3
0
        /// <summary>
        /// フォームコンストラクタ
        /// </summary>
        public MainForm()
        {
            InitializeComponent();

            this.ShowInTaskbar = false;

            //初期設定
            UpperProxyDefault = new UpperProxy(Gi_Proxy.Properties.Settings.Default.UpperIP, Gi_Proxy.Properties.Settings.Default.UpperPort);
            SettingDefault = new SettingState(UpperProxyDefault,
                Gi_Proxy.Properties.Settings.Default.PassState,
                Gi_Proxy.Properties.Settings.Default.PassSet);

            //ダブルバッファ処理を入れてちらつき防止
            this.DoubleBuffered = true;
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);
            this.UpdateStyles();

            //default初期化
            GraphData = new Dictionary<string, NodeNetwork>();
            GraphData.Add(MainNodeParty, new NodeNetwork());
            BanList = new List<string>();

            //ブロックしているリストをSettingから取得
            foreach (string Dm in Gi_Proxy.Properties.Settings.Default.Banlist.Split('/'))
            {
                if (Dm == "") continue;
                BanList.Add(Dm);
            }

            //ステータスバー表記
            NotifyIcon1.Text=ApplicationName;

            //初期ノード
            GraphData[MainNodeParty].Nodes.InitNode("localhost", 1.0d, 0.0d, 0.0d);
            GraphData[MainNodeParty].Nodes["localhost"].NodeShape.Click += new System.EventHandler(this.NodeShape_Click);
            GraphData[MainNodeParty].Nodes["localhost"].NodeShape.MouseUp += new MouseEventHandler(this.NodeShape_MouseUp);
            GraphData[MainNodeParty].Nodes["localhost"].NodeShape.MouseMove += new MouseEventHandler(this.NodeShape_MouseMove);
            GraphData[MainNodeParty].Nodes["localhost"].NodeShape.ContextMenuStrip = this.contextMenuStrip1;

            //フォームの初期化
            InitForm();

            //ダブルバッファパネルにホイールのイベントを追加する
            this.doubleBufferPanel1.MouseWheel += new MouseEventHandler(this.doubleBufferPanel1_MouseWheel);

            //BBPPsの親
            this.sc.Parent = this.doubleBufferPanel1;

            //ノードの描画を開始
            timer1.Enabled = true;

            //サーバーソケット初期化
            Server = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            IPAddress IP = IPAddress.Parse("127.0.0.1");
            IPEndPoint IPEndPoint = new IPEndPoint(IP, 9000);
            Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, 1);
            Server.Bind(IPEndPoint);
            Server.Listen(5);

            //クライアントからの受信を開始する
            ThProxy = new Thread(GetProxyRequest);
            ThProxy.Start();
        }