Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C# 4.0

Golabi Proxy Server

Rate me:
Please Sign up or sign in to vote.
4.79/5 (10 votes)
20 Sep 2011CPOL2 min read 65.8K   3.7K   21  
This is a proxy server with a client that can encrypt your browser request.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;

namespace GolabiProxyServer
{
    class ProxyTCPListener
    {
        private TcpListener _Listener;
        private ConnectionInfo _Info;

        public ProxyTCPListener(ConnectionInfo info)
        {
            this._Info = info;
            this._Listener = new TcpListener(this._Info.LocalIP, this._Info.LocalPort);
        }

        public void StartServer(GolabiServerUI messageCenter, string key)
        {
            this._Listener.Start();
        }

        public void AcceptConnection()
        {
            if (this._Listener.Pending())
            {
                Socket newClient = this._Listener.AcceptSocket();
                this._Info.MessageCenter.setMessage("ClientAccepted...");
                ClientConnection client = new ClientConnection(newClient, this._Info);
                client.StartHandling();
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer رایان پایا داده محاسب
Iran (Islamic Republic of) Iran (Islamic Republic of)
Bachelor of computer software engineer at Urmia University of Technology,

Masters of computer software engineer at Shahid Beheshti University,

Microsoft Certified Solution Developer : Web Applications,

Microsoft Specialist : HTML5 , CSS3 , javascript,

MCTS at Mojtame Fanni Tehran (MFT)


My Server Solution Blog

Comments and Discussions