SOCKS5 User Authentication and IP Bind problem!

IN PROGRESS
Bids
3
Avg Bid (USD)
$41
Project Budget (USD)
$30 - $30

Project Description:
My project working (without user authentication and with lan default ip)

[url removed, login to view] bind problem. i've several ip addresses. All of the incoming connections was bind to default ip. how can do bind any ip without default ip?
[url removed, login to view] i have used SOCKS_AUTH project confused.

any body help me? thanks
here is part of my code.

NetworkStream socksClientStream = socksClient.GetStream();
/*
* supported methods part
*/
byte[] authFields = new byte[2];
socksClientStream.Read(authFields, 0, 2);
// read n supported methods
byte[] methods = new byte[authFields[1]];
socksClientStream.Read(methods, 0, methods.Length);
/*
* method selection part
*/
byte[] selectedAuthMethod = { SOCKS_VERSION, SOCKS_NOAUTH };
socksClientStream.Write(selectedAuthMethod, 0, 2);

// return version and auth method "no auth"

byte[] requestFields = new byte[4];
socksClientStream.Read(requestFields, 0, 4);

// adresstypes ipv4 and hostname are supported
string connection_target = "";
int target_port;
if (requestFields[3] == SOCKS_IPV4ADDR )
{
//ip4v adress is requested
byte[] target_data = new byte[4];
socksClientStream.Read(target_data, 0, 4);
IPAddress ip = new IPAddress(target_data);
connection_target = ip.ToString();
}
else if (requestFields[3] == SOCKS_DNSNAME )
{

byte[] domainname_length = new byte[1];

socksClientStream.Read(domainname_length, 0, 1);
byte[] target_data = new byte[domainname_length[0]];

socksClientStream.Read(target_data, 0, domainname_length[0]);

connection_target = Encoding.Default.GetString(target_data);
}
else
{
//unsupported addresstype

}

//if requested address is supported
if (connection_target != "")
{

/*
* server client connection part
*/


//doc: byteorder
byte[] bintargetport = new byte[2];
socksClientStream.Read(bintargetport, 0, 2);
byte[] tmp_byteorder = new byte[2];
tmp_byteorder[0] = bintargetport[1];
tmp_byteorder[1] = bintargetport[0];
target_port = (int)BitConverter.ToUInt16(tmp_byteorder, 0);

serverClient = new TcpClient(connection_target, target_port);


/* **
* reply part
*/

if (serverClient.Connected)
{
// reply successful audience
byte[] reply = new byte[10];
//version
reply[0] = SOCKS_VERSION ;
// replycode
reply[1] = SOCKS_REPLYSUCCESS ;
//reserved and 0
reply[2] = 0;
// addresstype
reply[3] = 1;
string ip = serverClient.Client.LocalEndPoint.ToString().Split(':')[0];
IPAddress ipaddr = IPAddress.Parse(ip);
reply[4] = ipaddr.GetAddressBytes()[0];
reply[5] = ipaddr.GetAddressBytes()[1];
reply[6] = ipaddr.GetAddressBytes()[2];
reply[7] = ipaddr.GetAddressBytes()[3];
int port = int.Parse(serverClient.Client.LocalEndPoint.ToString().Split(':')[1]);

reply[8] = BitConverter.GetBytes((UInt16)port)[0];
reply[9] = BitConverter.GetBytes((UInt16)port)[1];
socksClientStream.Write(reply, 0, 10);

/*
* tcp redirection
*/


NetworkStream serverClientStream = serverClient.GetStream();

bool ioError = false;


while (serverClient.Connected && socksClient.Connected && !ioError )
{
..
}

Additional Project Description:
05/23/2013 at 19:56 SST
project has attached. u can try and test it

Skills required:
C# Programming
Additional Files: socks5.rar
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 34
in 3 days
$ 30
in 1 days
$ 33
in 3 days
$ 60
in 3 days