Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // For SGIP:
- // http://djazz.mine.nu/apps/sgip/
- header("content-type: text/plain");
- header("Access-Control-Allow-Origin: *");
- set_time_limit(3);
- $ip = $_GET['ip'];
- $port = isset($_GET['port'])? intval($_GET['port']) : 10052;
- $password = isset($_GET['pswd'])? $_GET['pswd'] : '';
- $result = array();
- $result['error'] = 0;
- $tcp = @fsockopen("localhost", 8007, $errno, $errstr, 10);
- if(!$tcp) {
- $result['error'] = 5;
- echo json_encode($result);
- exit;
- }
- fwrite($tcp, json_encode(array("ip" => $ip, "port" => $port, "password" => $password)));
- echo fread($tcp, 1024*1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement