I would like someone to build for me a simple byte proxy which works much like datapipe.c except it runs as a Windows NT Service and initializes the connection itself rather than listening for a connection on a port. This is not just a matter of converting the datapipe.c application to be a Windows Service however since there are some simple commands the proxy needs to recognize and treat appropriately.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Complete ownership and distribution copyrights to all work purchased.
As well as the following application requirements:
- Upon starting the service, it shall attempt to connect to a host and port specified by one or two registry key values. If the connection fails, the service should sleep for N seconds and make another attempt to connect, where N is defined by a registry key value.
- Upon successfully connecting to that server and port, it shall remain idle until receiving a command. The commands are:
- The Format for the commands are binary and described as follows:
- PING should always be a flat length of 9 or 10 bytes (depending on how many bytes a long int is in C on NT platforms)
- FILETRANSFER has the following format:
FILETRANSFER:[string filename]:[long integer total bytes]:[bytes of file]
- DISABLEINPUT should always be a flat length of 17 bytes:
- PORTFORWARD is of the format:
PORTFORWARD:[port to forward data to as an int]:[total bytes of data as long int]:[data bytes off incoming stream]
For every command except PORTFORWARD I require just a function stub to be defined and called whenever the command is received over the socket. The function does not need to perform any work, but the necessary parameters should be passed, such as the bytes received for FILETRANSFER or the integer value for PING.
For PORTFORWARD there shall be fully functional multi-threaded capability to handle the input and output streams between the service and the local port and the service and the server. The idea is to have the proxy receive a PORTFORWARD command and have it connect to the localhost and whatever port that is specified in the command. If the connection already exists, then it shall continue to write the bytes to the existing socket connection. The service should also proxy all data back to the server and encode the data as a PORTFORWARD command in the same format as defined above.
The Service should never display any GUI messages including error messages or dos windows while running.
The developer should also correspond with me to verify that you understand what needs to be accomplished.
I have attached an example PORTFORWARD command. It should be viewed with a hex editor to interpret it correctly. It tells the service to proxy 50 bytes worth of data to port 37 on the localhost.
I am fully open to suggestions for improving the design.
Windows NT and Derivitives of NY (Win2K, WinXP).