Simple Proxy?

06/06/2011 11:31 fatihy93#1
Hi im Python coder but i try to learn C#. I need proxy example. Any one can give me?

Ps: I try to run pushdex's simple proxy but i cant run this program :/
06/06/2011 16:18 Kazuyaš#2
[Only registered and activated users can see links. Click Here To Register...]

read this thread
06/06/2011 19:24 fatihy93#3
Quote:
Originally Posted by Kazuyaš View Post
[Only registered and activated users can see links. Click Here To Register...]

read this thread
Thank you. Realy this is proxy simple :confused: This program only connect to silkroadonline without client :/ It doesnt open port for bot connection.
06/06/2011 20:25 bootdisk#4
This is just a port of pushedx's api to Python.
You should code yourself the part listening part of the bot connection (port 22580).
But why would you need to open a port for a bot when you can code it directly in Python? :D
06/06/2011 20:45 fatihy93#5
Quote:
Originally Posted by bootdisk View Post
This is just a port of pushedx's api to Python.
You should code yourself the part listening part of the bot connection (port 22580).
But why would you need to open a port for a bot when you can code it directly in Python? :D
Lol you're right :p Ok but how can i connect this connector with loader? I guess this is directly connect to silkroad without client. Can u tell to me ? :D
06/06/2011 21:34 bootdisk#6
This port in its current state can't do clientless because I'm really busy in real life to start the handling of the 0x600D packets (lol I shouldn't be on forums either but it's not time consuming :) ) but it can act directly as a pure Python proxy.

You've to think in this way:

Quote:
[SRO's server] <-> [your python app with pySilkroad] <-> [SRO's Client]
Your Python app will connect to the official servers, handle all the security part and it will send unencrypted packets to your SRO client. If you've seen server development, once you've done all the initialization for this security you just have to send the 0x5000 packet with the 0x01 as its flag (which means no security at all).

Then it's just a matter of decrypt packets sent from the server and send them to your client and encrypt the packets sent from the client to the server. So (S=Server, P=Python's Proxy, C=Client):
  1. [S->P]Server sends encrypted packets
  2. [P->C]Decryption of packets and sending of them to the client
  3. [C->P]Client has non encrypted response for the proxy to send to the server
  4. [P->S]The proxy encrypts them and send them back to the server

The only thing you need to do is to open a listening socket for your client and redirect it to your listening socket.
Also, you've to check for special packets that MUST be encrypted (item movement on inventory and so...).

It sounds complicated but it's not, give it a try, it's by far interesting and also... you could give me a hand by submitting patches or being part of its development (which I'm going to really appreciate :) ).
06/07/2011 08:23 fatihy93#7
Quote:
Originally Posted by bootdisk View Post
This port in its current state can't do clientless because I'm really busy in real life to start the handling of the 0x600D packets (lol I shouldn't be on forums either but it's not time consuming :) ) but it can act directly as a pure Python proxy.

You've to think in this way:



Your Python app will connect to the official servers, handle all the security part and it will send unencrypted packets to your SRO client. If you've seen server development, once you've done all the initialization for this security you just have to send the 0x5000 packet with the 0x01 as its flag (which means no security at all).

Then it's just a matter of decrypt packets sent from the server and send them to your client and encrypt the packets sent from the client to the server. So (S=Server, P=Python's Proxy, C=Client):
  1. [S->P]Server sends encrypted packets
  2. [P->C]Decryption of packets and sending of them to the client
  3. [C->P]Client has non encrypted response for the proxy to send to the server
  4. [P->S]The proxy encrypts them and send them back to the server

The only thing you need to do is to open a listening socket for your client and redirect it to your listening socket.
Also, you've to check for special packets that MUST be encrypted (item movement on inventory and so...).

It sounds complicated but it's not, give it a try, it's by far interesting and also... you could give me a hand by submitting patches or being part of its development (which I'm going to really appreciate :) ).
Finally i need only open agent and gateway server port to connect my connector with client ?
06/07/2011 15:10 bootdisk#8
Your proxy will receive the ip and port of the real server (Xian, etc...) when you log in.
You should at this point connect the proxy to that server and port.
At that point you can do two thing for the client:

1) Tell the client the proxy's ip address and port and it will automatically reconnect. And it can be the same address and port.

2) Send the 0xA103 packet with only one byte with the value "1" (this doesn't close the connection between your client and your proxy and I think it's better than closing and opening a socket). I tried this on an emu and it was better because it let me have 1 single server instead of 100 executables... I just wanted to tell you that is possible and might be "cool" to use it.