C++ Socket Relay Application

Completado Publicado May 18, 2012 Pagado a la entrega
Completado Pagado a la entrega

I need a simple C++ socket server to manage socket connections and forward requests to an external PHP script. Permission validation and all other requests will be handled via external PHP scripts. The socket server will scan either a system memory variable or broadcast file to update connected sockets with new information. Further details can be found in the scope.

## Deliverables

Socket Relay Application Scope

May 16th 2012

UPDATED May 22nd 2012

General Specifications

OS: Linux/Unix

Language: C++

Client Application is built in Flash XML Sockets. The application needs to work with cross domain polices and parse incoming XML requests. See attachments for sample client application.

Also see attachments for sample PHP files to test execution.

Mandatory Functionality.

Application Settings:

Server Port

Server IP

Logging // true or false

Log Duration // Duration to keep log files in days.

Log Path // Full path to folder to store log files.

Authentication Path // Full path to external file to process validation

Request Path // Full path to external file to process incoming requests.

Broadcast Path // Full path to the broadcasting file.

Policy File Path // Full path to policy XML file.

**Logging:**

Log all incoming connections and requests to 2 files in the log path.

User log file naming format: log-[userid][url removed, login to view]

Activity log file naming format: [url removed, login to view]

Remove log files older than specified days in settings every 12 hours.

**Incoming Connections:

**Return policy file when requested

Validate credentials:

Execute a PHP file and forward the variables user ID and authcode

Variables need to be converted from XML to variables and passed as strings.

e.g. path/[url removed, login to view][id]&auth=[authcode]

Sample Auth Request

<request>

<authcode>samplecode</authcode>

<secret>null</secret>

<userid>1</userid>

<page>null</page>

<request>null</request>

<data></data>

</request>

(This file will return two params: status, secret)

Upon validation:

Store the open socket connection by user ID.

Store the secret with the socket and user ID.

(Secret will be used for validating incoming requests)

**Incoming Requests:**

Validate credentials:

Check passed secret with stored secret.

Upon validation:

Execute a PHP file forwarding the variables: user, page, request, data

Variables need to be converted from XML to variables and passed as strings.

e.g. path/[url removed, login to view][id]&page=[page]&request=[request]&data=[data]

Sample Incoming Request

<request>

<authcode>samplecode</authcode>

<secret>samplesecret</secret>

<userid>1</userid>

<page>index</page>

<request>SendMessage</request>

<data>

<message>Sample Message</message>

</data>

</request>

The PHP script will return a string of messages separated by a line break "\n", each message will have the userid and message, separated by a string. The message should be passed back to the Flash Client as an XML object.

Loop the returned messages and broadcast the messages to their corresponding socket connections by user ID.

Example PHP Response:

1,messagestring1\n2,messagestring2

Validate a socket is active for the corresponding user ID before attempting to broadcast.

Example Broadcast to Flash Client:

<response>

<data>

<message>messagestring1</message>

</data>

</ response >

Additional Desired Functionality.

**Command Line User Interface (Not GT) or External Web Interface**

I would like a simple user interface that lists all active connections by corresponding user ID and when I select a user/connection, it should show a real time request log for the selected user. I would also like the ability to select the user "ALL" which will show a real time log of all user requests to the right.

**Dropping a Connection**

I would like the ability to either enter into command line a command to drop a connected user ID or click the user in the UI and click drop user.

**Blocking and Unblocking a User**

I would also like the ability to block a user which will auto drop the user and reject future connections, would also need the ability to unblock the user.

Programación en C Arquitectura de software

Nº del proyecto: #2742955

Sobre el proyecto

8 propuestas Proyecto remoto Activo Jun 1, 2012

Adjudicado a:

chatvideogame

See private message.

$212.5 USD en 30 días
(20 comentarios)
5.4

8 freelancers están ofertando un promedio de $305 por este trabajo

Kartoos

See private message.

$350.2 USD en 30 días
(77 comentarios)
6.3
orsm

See private message.

$425 USD en 30 días
(5 comentarios)
5.6
mariusbucurvw

See private message.

$250.75 USD en 30 días
(40 comentarios)
5.1
zhoumo

See private message.

$360.4 USD en 30 días
(7 comentarios)
3.8
christophertech

See private message.

$340 USD en 30 días
(2 comentarios)
2.2
turiyaconsvw

See private message.

$246.5 USD en 30 días
(0 comentarios)
0.0
muselevw

See private message.

$250.75 USD en 30 días
(2 comentarios)
0.0