Stupid question, is your web server on the same machine as the multiplexer? If the answer is no, then you are using the wrong IP. (That IP means "Myself" so the webserver would be trying to connect to itself.)
If everything is on the same machine, I'm not sure what to tell you other than to double check the firewall.
It's on the same machine, and it's definitely connecting because those messages appear in the server console. I even temporarily shut off iptables in attempt to disprove your firewall theory.
I basically have the same config as Silentspy as well.
I've finally gotten a chance to really look at this and it seems the prompt is what is causing issues. (apparently I never upgraded my own copy of the multiplexer.)
Anyway, if you replace mc_interface.php with this, it should work.
<?php
include( "mcterm_cfg.php" );
@session_start();
//get password
if( isset( $_SESSION['mineremote_password'] ) ) {
$password = $_SESSION['mineremote_password'];
} else {
$password = "";
}
//checks to see if the password is valid
function check_pwd() {
global $server, $port, $password;
$rval = FALSE;
$socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
if( socket_connect( $socket, $server, $port ) === FALSE ) {
exit( socket_strerror( socket_last_error( $socket ) ) );
}
//check the prompt line
$line = socket_read( $socket, 1024 );
if( preg_match( '/no password/i', $line ) ) {
//no password set
$rval = TRUE;
} else {
//send the password and check the resposne
socket_write( $socket, $password );
$line = socket_read( $socket, 1024 );
if( substr_compare( '+ Access granted', $line, 0, 16 ) == 0 ) {
$rval = TRUE;
}
}
socket_close( $socket );
return $rval;
}
//runs a cmd and returns the response
function run_cmd( $cmd ) {
global $server, $port, $password, $response_delay;
$socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
if( socket_connect( $socket, "localhost", $port ) === FALSE ) {
exit( socket_strerror( socket_last_error( $socket ) ) );
}
//check the prompt
$line = socket_read( $socket, 1024 );
if( !preg_match( '/no password/i', $line ) ) {
//sign in with the password and check to see if it worked
socket_write( $socket, $password );
$line = socket_read( $socket, 1024 );
if( substr_compare( '+ Access granted', $line, 0, 16 ) != 0 ) {
return "<b style='color: red;'>ACCESS DENIED!</b><br/>\n";
}
}
//do the command
socket_write( $socket, $cmd );
$socket_list = Array( $socket );
$null = NULL;
//read the response allowing $response_delay seconds between lines before closing the connection
$line = "";
while( socket_select( $socket_list, $null, $null, $response_delay ) != FALSE ) {
$line .= socket_read( $socket, 1024 )."<br/>";
$socket_list = Array( $socket );
}
//close the connection
socket_close( $socket );
//return the response
return $line;
}
//This just checks for msgs on the server and returns the first that it finds
//This is following the long-poll model for persistent ajax connections
function poll_server_msgs() {
global $server, $port, $password, $poll_timer;
$socket = socket_create( AF_INET, SOCK_STREAM, SOL_TCP );
if( socket_connect( $socket, "localhost", $port ) === FALSE ) {
exit( socket_strerror( socket_last_error( $socket ) ) );
}
//check the prompt
$line = socket_read( $socket, 1024 );
if( !preg_match( '/no password/i', $line ) ) {
//sign in with the password and check to see if it worked
socket_write( $socket, $password );
$line = socket_read( $socket, 1024 );
if( substr_compare( '+ Access granted', $line, 0, 16 ) != 0 ) {
return "<b style='color: red;'>ACCESS DENIED!</b><br/>\n";
}
}
$socket_list = Array( $socket );
$null = NULL;
//check for any msgs
$line = "";
if( socket_select( $socket_list, $null, $null, $poll_timer ) != FALSE ) {
$line .= socket_read( $socket, 1024 )."<br/>";
$socket_list = Array( $socket );
}
//close the connection
socket_close( $socket );
//return the response
return $line;
}
?>
I also updated the copy of the file in the zip bundle in the first post in case you would rather do it that way.
Rollback Post to RevisionRollBack
Tis far better to be a witty fool than a foolish wit.
very odd but i keep only getting ACCESS DENIED all the time,
I'm having the same problem with the latest version. I log in with the appropriate password, then it sits there for 15 seconds before starting to give the "ACCESS DENIED" messages. I checked the Multiplexer output, and it looked like this from when I was trying that:
It's on the same machine, and it's definitely connecting because those messages appear in the server console. I even temporarily shut off iptables in attempt to disprove your firewall theory.
I basically have the same config as Silentspy as well.
Anyway, if you replace mc_interface.php with this, it should work.
I also updated the copy of the file in the zip bundle in the first post in case you would rather do it that way.
I'm having the same problem with the latest version. I log in with the appropriate password, then it sits there for 15 seconds before starting to give the "ACCESS DENIED" messages. I checked the Multiplexer output, and it looked like this from when I was trying that:
Drat and bother.
EDIT: oh yeah, for reference...
Relevant config in my mineremote.ini:
And from mcterm_cfg.php: