Created
August 30, 2013 10:24
-
-
Save J7mbo/6388474 to your computer and use it in GitHub Desktop.
aerys conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Aerys\Config\Bootstrapper; | |
use Aerys\Handlers\ReverseProxy\ReverseProxyLauncher; | |
use Aerys\Handlers\DocRoot\DocRootLauncher; | |
require dirname(__DIR__).'/vendor/autoload.php'; | |
require '/var/www/Aerys/autoload.php'; | |
require __DIR__ . '/EchoEndpoint.php'; | |
date_default_timezone_set('GMT'); | |
$config = [ | |
'localhost' => [ | |
'listenOn' => '*:80', | |
'name' => 'localhost', | |
'application' => new ReverseProxyLauncher([ | |
'backends' => [ | |
'127.0.0.1:1337', | |
], | |
'proxyPassHeaders' => [ | |
'Host' => 'localhost', | |
'X-Forwarded-For' => '$remoteAddr' | |
], | |
]), | |
'mods' => [ | |
'websocket' => [ | |
'/echo' => [ | |
'endpoint' => 'EchoEndpoint' | |
] | |
] | |
] | |
], | |
'Silex.local' => [ | |
'listenOn' => '*:80', | |
'name' => 'Silex.local', | |
'application' => new ReverseProxyLauncher([ | |
'backends' => [ | |
'127.0.0.1:1337', | |
], | |
'proxyPassHeaders' => [ | |
'Host' => 'Silex.local', | |
'X-Forwarded-For' => '$remoteAddr' | |
], | |
]), | |
'mods' => [ | |
'websocket' => [ | |
'/echo' => [ | |
'endpoint' => 'EchoEndpoint', // <-- Our websocket endpoint class | |
] | |
] | |
] | |
] | |
]; | |
(new Bootstrapper())->createServer($config)->start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment