mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 12:52:42 +01:00
Let Aphlict listen on the specified host
Summary: We allow user to specify the host to listen to but we listen on 127.0.0.1 instead. Test Plan: Hardcoded the path and verified that I can connect to the host from other machine. Verified that `localhost` still doesn't allow remote connections. Reviewers: ddfisher, epriestley, nh Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4238
This commit is contained in:
parent
6dd0169873
commit
776a240870
2 changed files with 4 additions and 2 deletions
|
@ -59,6 +59,7 @@ $foreground = $args->getArg('foreground');
|
||||||
$server_argv = array();
|
$server_argv = array();
|
||||||
$server_argv[] = csprintf('--port=%s', $client_uri->getPort());
|
$server_argv[] = csprintf('--port=%s', $client_uri->getPort());
|
||||||
$server_argv[] = csprintf('--admin=%s', $server_uri->getPort());
|
$server_argv[] = csprintf('--admin=%s', $server_uri->getPort());
|
||||||
|
$server_argv[] = csprintf('--host=%s', $server_uri->getDomain());
|
||||||
|
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$server_argv[] = csprintf('--user=%s', $user);
|
$server_argv[] = csprintf('--user=%s', $user);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* sudo node aphlict_server.js --user=aphlict
|
* sudo node aphlict_server.js --user=aphlict
|
||||||
*
|
*
|
||||||
* You can also specify `port`, `admin` and `log`.
|
* You can also specify `port`, `admin`, `host` and `log`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var config = parse_command_line_arguments(process.argv);
|
var config = parse_command_line_arguments(process.argv);
|
||||||
|
@ -12,6 +12,7 @@ function parse_command_line_arguments(argv) {
|
||||||
var config = {
|
var config = {
|
||||||
port : 22280,
|
port : 22280,
|
||||||
admin : 22281,
|
admin : 22281,
|
||||||
|
host : '127.0.0.1',
|
||||||
user : null,
|
user : null,
|
||||||
log: '/var/log/aphlict.log'
|
log: '/var/log/aphlict.log'
|
||||||
};
|
};
|
||||||
|
@ -200,7 +201,7 @@ var receive_server = http.createServer(function(request, response) {
|
||||||
response.end();
|
response.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
}).listen(config.admin, '127.0.0.1');
|
}).listen(config.admin, config.host);
|
||||||
|
|
||||||
function broadcast(data) {
|
function broadcast(data) {
|
||||||
for (var client_id in clients) {
|
for (var client_id in clients) {
|
||||||
|
|
Loading…
Reference in a new issue