Config fix, updated README

This commit is contained in:
Marek Rost 2018-06-19 18:11:41 +02:00
parent 8a317800ef
commit 53c70b72ce
3 changed files with 11 additions and 6 deletions

View File

@ -6,15 +6,18 @@ Socks5 proxy written in PHP based on [workerman](https://github.com/walkor/Worke
2. ```composer install``` 2. ```composer install```
## Config
Edit file ```config.php```
## Start ## Start
php start.php start -d ```php start.php start -d```
## Stop ## Stop
php start.php stop ```php start.php stop```
## Status ## Status
php start.php status ```php start.php status```
## Other links ## Other links
https://github.com/walkor/shadowsocks-php https://github.com/walkor/shadowsocks-php
https://github.com/walkor/php-http-proxy https://github.com/walkor/php-http-proxy

View File

@ -1,3 +1,5 @@
<?php
$AUTH_ENABLED = 0; $AUTH_ENABLED = 0;
$USERNAME = 'changeme'; $USERNAME = 'changeme';
$PASSWORD = '1234'; $PASSWORD = '1234';

View File

@ -6,7 +6,6 @@ use \Workerman\Connection\AsyncTcpConnection;
// 自动加载类 // 自动加载类
require_once __DIR__ . '/vendor/autoload.php'; require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config.php'; require_once __DIR__ . '/config.php';
define('STAGE_INIT', 0); define('STAGE_INIT', 0);
@ -37,6 +36,7 @@ $worker->onConnect = function($connection)
}; };
$worker->onMessage = function($connection, $buffer) $worker->onMessage = function($connection, $buffer)
{ {
global $AUTH_ENABLED, $USERNAME, $PASSWORD;
switch($connection->stage) switch($connection->stage)
{ {
case STAGE_INIT: case STAGE_INIT: