Multivit4min / TS3-NodeJS-Library

TeamSpeak 3 Server Query Library supports SSH and RAW Query
https://multivit4min.github.io/TS3-NodeJS-Library/
MIT License
149 stars 20 forks source link

Socket Timeout reached #174

Closed TigerGamer134 closed 2 years ago

TigerGamer134 commented 2 years ago

Describe the bug When connecting on the same machine as the TS server, I get a "Error: Socket Timeout reached" issue, but when I try to run it on another machine such as my localhost or another VPS it works just fine.

To Reproduce Just try connecting on the same machine as a TS Server

Expected behavior N/A

Versions used

Additional context N/A

Multivit4min commented 2 years ago

Can you test that you can connect with a telnet / ssh client to your teamspeak server directly? I dont see a reason why it should work on one server but not on another. Other issues could be that the TeamSpeak Server has banned the Query IP (which i am not 100% sure if this does not matter when connecting through localhost)

TigerGamer134 commented 2 years ago

@Multivit4min Would you like for me to try telnet on another machine or the localhost machine? I have also checked the banned IPs and allowed IPs which it is not on the banned.

Multivit4min commented 2 years ago

test the connection from the machine which does not work with the connection informations you use to connect to your teamspeak server in your node project

TigerGamer134 commented 2 years ago

I will try this. And could it be something with the fact that I use pterodactyl?

TigerGamer134 commented 2 years ago

So I just tried on the same machine that the ts server is running on and I got a connection refused. image

Multivit4min commented 2 years ago

seems like you are using wrong connection informations, the default telnet port is 10011

TigerGamer134 commented 2 years ago

Yeah, I changed my query port to 50112 which I then changed my telnet command to after I sent that as I realized, which still gave me the same result. And that query port 50112 works fine for the bot when it's not on the same machine

TigerGamer134 commented 2 years ago

Nevermind my last, it did let me connect.

TigerGamer134 commented 2 years ago

image

Multivit4min commented 2 years ago

so is the issue resolved?

TigerGamer134 commented 2 years ago

so is the issue resolved?

No. I was able to connect to the server via telnet like you asked if I was able too. Still cannot connect with the bot itself on the same machine.

Multivit4min commented 2 years ago

but you are using the same queryport? and you are using localhost or 127.0.0.1 to connect from your node application? do you have a bind ip set for your teamspeak server in a config.ini?

TigerGamer134 commented 2 years ago

I am using the same connection information that I use when testing on my computer. I tried using both localhost & 127.0.0.1 on the machine, which still didn't work. I am currently using the main servers IP which still doesn't work. (That is what I use on my computer. the machines IP)

Multivit4min commented 2 years ago

Sorry but i absolutely dont know why it should work on one machine to connect via localhost to the teamspeak server but not on another, is there any special setup?

I myself always connect via localhost to my TeamSpeak Server and never run into that issue Double check your Query Port, validate that you dont have any bind ip set to your teamspeak server which might interfer.

If running on linux you can check with netstat -tulpn on what port and ip the teamspeak server is bound

TigerGamer134 commented 2 years ago

Would it matter that it's in a "docker proxy"? As it said LISTEN docker/proxy something and the. The Ip and Port accordingly

TigerGamer134 commented 2 years ago

The exact things I found from running that command are as follow:

udp        0      0 REDACTED:50112      0.0.0.0:*                           13823/docker-proxy
tcp        0      0 REDACTED:50112      0.0.0.0:*               LISTEN      13809/docker-proxy
TigerGamer134 commented 2 years ago

And the teamspeak server says this when starting up:

2022-03-14 20:31:35.666935|INFO    |Query         |   |listening for query on 0.0.0.0:50112, [::]:50112
2022-03-14 20:31:35.667415|INFO    |Query         |   |listening for ssh query on 0.0.0.0:10022, [::]:10022
2022-03-14 20:31:35.667645|INFO    |Query         |   |listening for http query on 0.0.0.0:10080, [::]:10080
Multivit4min commented 2 years ago

sorry but i have never used docker, but when you say you can reach from the machine where your nodejs project runs the teamspeak server via the telnet cli then something must be specifically wrong with the teamspeak library which i cant reproduce without a docker setup

TigerGamer134 commented 2 years ago

I have resolved this. I wasn't using the appropriate "docker IP" to connect from one docker container to another.