Go Back   EQEmulator Home > EQEmulator Forums > Misc > Misc::Off Topic

Misc::Off Topic Want to talk about something that has nothing to do with EverQuest or the emulator? Post here.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-05-2008, 10:38 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Unable to Connect Via Telnet with PHP

I am trying to get some tools working for my server that need direct telnet access to the server on port 9000 to use them. I have tried all I can think of to get this working. My PHP skills are pretty weak, so maybe I am doing something wrong. The only other thing I can think of is that the web hosting I am using to connect to the server remotely might be blocking port 9000. Though, I don't know why it would block that port.

Once I can verify that the connection is able to work, I can get the rest setup without much difficulty (I hope). For now, all I am trying to do is verify that I can get connected to the server, so this is a pretty basic file.

index.php
Code:
<?php

$Server='my.dyndns.com';  //of course my real dyndns address has been replaced here for the post
$Port='9000';
$user='username'; //username of my GM account on the server
$pass='password'; //password that I have in my accounts table for my GM account

$url = 'http://stormhavenserver.com/'; //this will eventually point back to the tool

$fp = fsockopen($Server, $Port);
$end = "<a href=$url>Go back to the Tool</a>";

function fConnect($fp,$Server,$Port,$user,$pass){
	if(!$fp){
	echo ("Error connecting host...");
	}else{
		fputs ($fp, "$user\r");
		echo("Login Accepted\r<br>");
		usleep(125000);   
      		fputs ($fp, "$pass\r");
		usleep(125000);
		echo("Password Accepted\r<br>");
	}
}

?>
Here is the error I get when I try to go to index.php (of course my.dns.com in this output was replaced so it doesn't show my real address):
Code:
Warning: fsockopen() [function.fsockopen]: unable to connect to my.dyndns.com:9000 (Connection timed out) in /home/stormhav/public_html/tools/status/index.php on line 3
()
If anyone has any ideas what could be wrong, I would love to get this working. I have been messing with it for a few hours and just can't figure it out :(
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 08-11-2008, 06:12 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I am still unable to figure out why this isn't working. I have even tried setting up the EQEmu Portal Tool on my web site, but it doesn't seem to work for telneting to the server. I would like to avoid having to run the tools I want directly on the server and would rather have my website run the tools and just have it connect to the server remotely.

Here is the Portal Tool I was trying to use to test if it could connect remotely:

EQEmuPortal
http://www.eqemulator.net/forums/showthread.php?t=19202

I have tried telneting to the server from webmin by telneting the to dyndns url and that works fine, so I assume that means that I am not blocking the connection coming into the server through my router. So, the only other thing I can think of is that the port 9000 is being block from leaving my web hosting, but I have no clue why they would do that...

Still looking for help if anyone has any ideas to get this working.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 08-11-2008, 08:48 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

I've had a friends not be able to find me right after my dynamic ip gets reset. For example, Windows is set to cache dns names for around a day. So If your server ip changes, the old IP stays in the cache. Right-click on the network Icon and 'repair connection' will clear the cache. Probably not the problem, but good to know.
Also try the 'DMZ Host IP Address' option with your router and server - I've had problems with router ports and Linux before- DMZ opens everything to one PC in the LAN.
Reply With Quote
  #4  
Old 08-12-2008, 06:06 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Getting to my server isn't an issue. I can connect to the EQEmu admin tool just fine. The problem is trying to get my website to connect to the server via telnet to be able to use the functions available there.

I will have to mess with router settings I guess and see if that helps. I was thinking of trying to use Port Triggering to change port 23 to 9000. That way, if port 9000 is being blocked by the web host I am using for whatever reason, I can just use port 23 and have it convert to port 9000 when it hits my router.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 08-12-2008, 08:12 PM
Angelox
AX Classic Developer
 
Join Date: May 2006
Location: filler
Posts: 2,049
Default

If you want to eliminate any doubts about the router, put it in DMZ mode for a while, if there's no difference when you do, then it won't be the router.
Reply With Quote
  #6  
Old 08-13-2008, 04:34 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, as I thought, setting it as a DMZ had no effect. I already have port 9000 opened, cause that is what the emulator uses, and that is the port I have to use to telnet into the server.

From another pc on my LAN, I am able to telnet to my server using "telnet my.dyndnsname.com 9000", but it doesn't work if I use "telnet my.dyndnsname.com:9000". I have also tried replacing the URL with my actual internet IP, but it still doesn't make any difference.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 01-23-2009, 01:57 PM
kedra
Sarnak
 
Join Date: May 2007
Posts: 71
Default

Your code seems to work fine for me.

I replaced your address and credentials with my own and added a call to that function and it spits out a success message. So maybe the problem your host?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:09 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3