planetteamspeak / ts3phpframework

Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
https://www.planetteamspeak.com
GNU General Public License v3.0
211 stars 59 forks source link

Connection refused #109

Closed jonerickson closed 6 years ago

jonerickson commented 6 years ago

Trying to implement this library into a project and I keep receiving a connection refused error.

// Create URI component
$uri = "serverquery://username:password@54.200.11.203:10011/";

// Create new object of TS3 PHP Framework class
$teamspeak = new TeamSpeak3();

// Connect to their server
$teamspeak->factory( $uri );

I have made sure the TS server has whitelisted the requesting web servers IP, the credentials are correct, ports are properly forwarded etc. I can telnet into the serverquery interface just fine from my workstation. What could I be missing? Thanks!

ronindesign commented 6 years ago

There could be networking issues from your web host.

I recommend accessing your webhost via SSH (most shared hosting provides this).

Then attempt to telnet from your webhost to your TS server.

It's clear your TS server's network is accessible externally, but your webhost may have additional configuration that could be interfering.

jonerickson commented 6 years ago

Apparently my shared hosting provider does not have telnet installed. Its a linux machine too..weird. Have any other options for testing connectivity?

ronindesign commented 6 years ago

Test with python (untested) [ref]: NB: Tested only in Python v3, syntax is similar but different for Python v2.

$ python                          
Python 3.7.0 (default, Jun 29 2018, 20:13:13) 
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> conn=socket.create_connection(('virtual.ronin.media',10011))

Should work (i.e. no output / error), then if it does, you can test further (untested):

>>> input=conn.makefile()
>>> print(input.readline())
TS3

>>> print(input.readline())

>>> print(input.readline())
Welcome to the TeamSpeak 3 ServerQuery interface, type "help" for a list of commands and "help <command>" for information on a specific command.

>>> conn.sendall(b'use 1\n\r')
>>> print(input.readline())

>>> print(input.readline())
error id=0 msg=ok
ronindesign commented 6 years ago

It may also be worth opening a ticket with your web host to see if they have any network configuration or outbound firewall rules...

ronindesign commented 6 years ago

Closing this for now, please let us know if you're still having trouble connecting to your host.