Proxy Out Guide

Sunset Rainbow and the Susnet Rainbow logo are registered trademarks of Sunset Rainbow, LLC.
© Jan 2010. All Rights Reserved.
Jan 2010
Sunset Rainbow Proxy Out Guide
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page i


Contents
Jan 2010
Sunset Rainbow Proxy Out Guide
i
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 1


Contacts
Contacts
* Web & Email
Web
When you purchased Proxy Out product you received a 'proof of purchase' code. This can be used to access 'my account' on our website. Do not share your proof of purchase code or product key(s) with anyone you don't trust with access to your data.

We suggest you create a user account with Sunset Rainbow to better protect your product key.

Documentaion is maintained on our website.

sunsetrainbow.com

Email
If you find any omissions or errors in this document, please send email detailing the error or omission to: info@sunsetrainbow.com
Jan 2010
Sunset Rainbow Proxy Out Guide
1
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 2


Introduction
Introduction
* Overview

Sunset Rainbow's Proxy Out detects whether visitors to your website are using a proxy service or not. You can use this information to provide enhanced services to proxy users or to deny services to proxy users.

SQL Encoder requires MySQL. If you need to work with a different database please contact Sunset Rainbow's support team.

Requests for new features are welcome and may be added to future editions of this software. Just contact us! (See Contacts section for email address).

Jan 2010
Sunset Rainbow Proxy Out Guide
2
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 3


Introduction
* Warnings & Important Notices
Product Keys
Do not share your product key with anyone. Doing so will compromise security.

We suggest you create a user account with Sunset Rainbow to better protect your product key.
Jan 2010
Sunset Rainbow Proxy Out Guide
3
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 4


Introduction
* License
Please refer to the page you downloaded the product from.

If ionCube loader is not installed and you have followed the setup instructions included with your copy of the software, please refer to ioncube.com.

ionCube is a registered trademark of ionCube Ltd (ioncube.com)

Jan 2010
Sunset Rainbow Proxy Out Guide
4
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 5


Introduction
* Setup Instructions
These instructions are included in a file that comes with your software package. They should open automatically when you use the window installer.

Note: All links will open in a different window/tab.

Step 1 - Setup ionCube Loader
If you do not already have ionCube loaders installed, please see the appropriate link:
Step 2 - Setup Proxy Out Example
Option A. If you do not have your own database connection script:
1. Edit --> sunsetrlib/proxyout/example/db.php
Then db.php file is your database script.
You can now use Proxy Out in your own web pages.

2. Go to the web address: YOURSERVER/sunsetrlib/proxyout/example.php

Option B. If you have your own database connection script:
1. Edit --> sunsetrlib/proxyout/img.php
Then img.php will refer to your database script.
You can now use Proxy Out in your own web pages.

2. To run the Test Page:
Edit --> sunsetrlib/proxyout/example/db.php
Go to the web address: YOURSERVER/sunsetrlib/proxyout/example.php

License Problems?
Use your Proof of Purchase code to access My Account.
Type the name of your website (domain name) in the license and set it. Then click 'Update License'.

For more information about the ionCube loader see ionCube.

Jan 2010
Sunset Rainbow Proxy Out Guide
5
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 6


Introduction
* PHP Environment

Proxy Out requires a database connection and a special fetch script. Examples are included with your Proxy Out software package. You should copy the fetch script (img.php) and rename it, placing it somewhere else on your website. Then refer to this location (path) when calling Proxy Out.

Example database connection script: db.php

<php
// You can use your own EXISTING db connection scripts...
// instead of this one.

//Connect To Database
global $dbconnection;
global $db;
function opendb()
{
	$hostname='myserveraddr'; // change to DB Server address given to you by your ISP
	$username="myusername"; // change to DB username
	$password="mypassword"; // change to your DB password
	$dbname=$username; // your ISP may require something else here!
	global $dbconnection;
	if (!($dbconnection = mysql_connect($hostname, $username, $password)))
	{
		die('Cannot connect to DB');
	}
	global $db;
	if (!($db=mysql_select_db($dbname, $dbconnection)))
	{
		die('Cannot use DB '.$dbname.'.');
	}
}
opendb();
?>

Example fetch script: img.php

<?php
// Change this to the location of your database connection script. See example/db.php
require_once('example/db.php');

// --- Do not change anything below this point ------------------------------------------
require_once('proxyout.php');
sr_proxyOut_query();
?>

Jan 2010
Sunset Rainbow Proxy Out Guide
6
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 7


Introduction
* PHP Examples
Using Proxy Out from within your own web pages is easy. The following examples assume you have setup the environment properly (see previous section).

PHP 5 Example

	// wherever your DB connection script is
	require_once('db.php');
	
	// Location of Proxy Out for PHP 5
	require_once('sunsetrlib/proxyout/proxyout5.php');

	$s=new sr_proxyOut();
	$s->queryfetch();
	echo $s->$english;
PHP 4 Example

	// Wherever your DB connection script is
	require_once('db.php'); 
	
	// Location of Proxy Out
	require_once('sunsetrlib/proxyout/proxyout.php');

	$r=sr_proxyOut_queryfetch();
	echo $r['english'];

Jan 2010
Sunset Rainbow Proxy Out Guide
7
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 8


sr_proxyOut Class - PHP 5
sr_proxyOut Class - PHP 5
3. Object
3.1 Information
Only available in the PHP 5 version

sr_proxyOut -- Class Object

Description
sr_proxyOut
Parameters
None.
Properties
status
english
client_ip
verified_client_ip
proxy_ip

See sr_proxyOut_fetch for property meanings.

 
Methods
MethodSame as PHP 4 Function
private_ip sr_proxyOut_private_ip
fetch sr_proxyOut_fetch
query sr_proxyOut_query
queryfetch sr_proxyOut_queryfetch
status_english sr_proxyOut_status_english
test_path sr_proxyOut_test_path
Jan 2010
Sunset Rainbow Proxy Out Guide
8
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 9


Core API - PHP 4 and PHP 5
Core API - PHP 4 and PHP 5
4. Function
4.1
4.1.1 Analyze collected Data: sr_proxyOut_fetch
sr_proxyOut_fetch -- Analyze collected data about IP
Description
mixed sr_proxyOut_fetch (string client_ip=$_SERVER['REMOTE_ADDR'], $code_only=0)
This function returns an array containing analysis results.
Parameters
client_ip: Internet Address (optional)
code_only: If set, only return the status code as a number (no array data).
Return Values
Array PropertyMeaning
status -2=DB Error
-1= DB not setup or empty
0=Client IS NOT using proxy
1=Uncertain (try fetch again later)
2=via proxy (seldom used)
3=via proxy
proxy_ipOnly set if status is 2 or 3.
client_ipClient IP. Will not be set if you explicitly pass client_ip to the function and it has previously been identified as a proxy server.
verified_client_ipOnly set if status is 0. Null otherwise.
englishHuman readable description of status
Note
Proxy Out clears out the database tables it uses, removing information more than 1 hour old, keeping only a list of verified proxy servers encountered. If you want to keep a complete history of findings you need to maintain your own database table.
Jan 2010
Sunset Rainbow Proxy Out Guide
9
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 10


Core API - PHP 4 and PHP 5
4.1.2 Private IP filter: sr_proxyOut_private_ip
sr_proxyOut_private_ip -- Identify Private IPs
Description
mixed sr_proxyOut_private_ip (string $address)
Identifies any IP addresses reserved for private networks (example 192.168.0.1). Such addresses are on your private network.

Return Values
ValueMeaning
1Address is private.
0Address is public.
Jan 2010
Sunset Rainbow Proxy Out Guide
10
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 11


Core API - PHP 4 and PHP 5
4.1.3 Start the detection process: sr_proxyOut_query
sr_proxyOut_query -- Transmits to client.
Description
int sr_proxyOut_query (string $path=DEFAULT, $wait=0 )
Scan remote server
Parameters
path URL path to PHP image script from the root directory. Omit the leading slash. The DEFAULT path is 'sunsetrlib/proxyout/img.php' The following example refers to a file in the 'myimages' directory on your server: 'myimages/foo.php'
wait Not recommended: Optional Microseconds to wait after performing the scan. More time increases the chance you can detect a new proxy or status with sr_proxyOut_fetch() during the same page loaded. Example: 250000 (.25 seconds)
Return Values
None.
Jan 2010
Sunset Rainbow Proxy Out Guide
11
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 12


Core API - PHP 4 and PHP 5
4.1.4 Scan & Analyze: sr_proxyOut_queryfetch
sr_proxyOut_queryfetch -- Scan and Analyze
Description
mixed sr_proxyOut_queryfetch (string $path=DEFAULT, $wait=0)
Combination of sr_proxyOut_query() and sr_proxyout_fetch(). If you want to analyze arbitrary IP addresses use sr_proxyout_fetch() instead.
Parameters
Same as sr_proxyOut_query() parameters.
Return Values
Same as sr_proxyOut_fetch() return values.
Jan 2010
Sunset Rainbow Proxy Out Guide
12
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 13


Core API - PHP 4 and PHP 5
4.1.4 Translate status code to English: sr_proxyOut_status_english
sr_proxyOut_status_english -- Provides status code meaning in English text.
Description
string sr_proxyOut_status_english (int $code)
This function returns the meaning of the code in English.
Parameters
code: A status code returned by sr_proxyOut_fetch().
Return Values
A string.
Jan 2010
Sunset Rainbow Proxy Out Guide
13
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 14


Core API - PHP 4 and PHP 5
4.1.5 Test query path: sr_proxyOut_test_path
sr_proxyOut_test_path -- Test query path
Description
string sr_proxyOut_test_path (string $path)
This function allows you to see if $path translates to the desired URL when passed to _sr_proxyOut_query() or _sr_proxyOut_queryfetch().
Parameters
Path: Location of file on your webserver. Without a leading slash or server information.

Example: myfolder/foo.php

Return Values
String containing a URL (web address).
Note
This function is for test purposes only. It will ONLY return the correct results when run as a script on your website.
Jan 2010
Sunset Rainbow Proxy Out Guide
14
Jan 2010 - Sunset Rainbow's Proxy Out Guide - Page 15


Core API - PHP 4 and PHP 5
4.1.6 Version Information: sr_proxyOut_version
sr_version -- Report product information.
Description
sr_proxyOut_version ()
This function prints out the Proxy Out version info.
Jan 2010
Sunset Rainbow Proxy Out Guide
15
Warning: [obfuscated](_yxy_manual.txt.compiled): failed to open stream: Permission denied in /srv/inhouse/public_html/sunsetrainbow.com/help/manual.php on line 678