jselbie / stunserver

Version 1.2. This is the source code to STUNTMAN - an open source STUN server and client code by john selbie. Compliant with the latest RFCs including 5389, 5769, and 5780. Also includes backwards compatibility for RFC 3489. Compiles on Linux, MacOS, BSD, Solaris, and Win32 with Cygwin. Windows binaries avaialble from www.stunprotocol.org.
http://www.stunprotocol.org
Apache License 2.0
1.44k stars 349 forks source link

stunclient "Unable to create local socket for TCP connection (hr == 8800000d)" #37

Closed hxr404 closed 2 years ago

hxr404 commented 4 years ago

Hello, I downloaded the Windows Builds and ran the command stunclient --proto tcp --localport 25577 stun.stunprotocol.org and it only displays the error message: Unable to create local socket for TCP connection (hr == 8800000d)

If I choose another localport or udp as protocol, than I don't get the error message, it displays the ips. How can I fix it? What did I wrong?

Thanks for your help and for this awesome tool.

jselbie commented 4 years ago

I'm guessing because another app has that port locked. That's just a guess. Error code d (13) is "permission denied".

Type this at an elevated command prompt:

netstat -b -a -n > out.txt notepad out.txt

Within notepad, search (CTRL+F) for a socket using that port by searching for this string

  :25577

The application that is already using that port will be listed on the line below it.

It's unusual, but not unwarranted, to use stunclient from a specific local port. What are you really trying to do?

jrs

On Wed, Nov 11, 2020 at 8:12 AM hxr404 notifications@github.com wrote:

Hello, I downloaded the Windows Builds and ran the command stunclient --proto tcp --localport 25577 stun.stunprotocol.org and it only displays the error message: Unable to create local socket for TCP connection (hr == 8800000d)

If I choose another localport or udp as protocol, than I don't get the error message, it displays the ips. How can I fix it? What did I wrong?

Thanks for your help and for this awesome tool.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jselbie/stunserver/issues/37, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHNSF4FMAO2LCYBPTAAJQDSPKZWRANCNFSM4TSFSPNA .

hxr404 commented 3 years ago

Thanks for the quick help. Here's the Output from the search:

 Es konnten keine Besitzerinformationen abgerufen werden.
  TCP    0.0.0.0:25577          0.0.0.0:0              ABH™REN
 [java.exe]
 Es konnten keine Besitzerinformationen abgerufen werden.
  TCP    [::]:25577             [::]:0                 ABH™REN
 [java.exe]

I try to run a minecraft bungeecord server without portforwarding. Is it even possible? or did I missunderstand something? I used ngrok, but I want something that also supports udp (and is'nt a proxy). Udp is the most important part, but at the moment I don't have a Minecraft Bedrock (udp) Client to test, so I first wanted to chek how it works with Minecraft Java (tcp).

When I ran the test, the clients weren't on, only the server, so the problem is with the Server.

jselbie commented 3 years ago

So minecraft appears to have a lock on TCP port 25577. I thought the client would use SO_REUSEADDR mode, but it doesn't appear to work for TCP sockets. Not sure whey.

Even if you did obtain a port mapping with stunclient, it's questionable if anyone else would be able to send UDP to that port without first doing a coordination with another external server. Your NAT will basically firewall any inbound UDP that you didn't first send outbound UDP to first.

What if your network configuration? Is it just a home residential NAT? What's wrong with port forwarding?

On Sat, Nov 14, 2020 at 5:06 AM hxr404 notifications@github.com wrote:

Thanks for the quick help. Here's the Output from the search:

Es konnten keine Besitzerinformationen abgerufen werden.

TCP 0.0.0.0:25577 0.0.0.0:0 ABH™REN

[java.exe]

Es konnten keine Besitzerinformationen abgerufen werden.

TCP [::]:25577 [::]:0 ABH™REN

[java.exe]

I try to run a minecraft bungeecord server without portforwarding. Is it even possible? or did I missunderstand something? I used ngrok, but I want something that also supports udp (and is'nt a proxy). Udp is the most important part, but at the moment I don't have a Minecraft Bedrock (udp) Client to test, so I first wanted to chek how it works with Minecraft Java (tcp).

When I ran the test, the clients weren't on, only the server, so the problem is with the Server.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jselbie/stunserver/issues/37#issuecomment-727204815, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHNSFZ6B6BNULH7IIMD4G3SPZ6GPANCNFSM4TSFSPNA .

hxr404 commented 3 years ago

Its a standart home router (fritz box) I don't want to use port forwarding, because I thought I could make it portable...

I thought, that the program finds an IP & Port, wich can bypass the NAT, so it can be used similar to ngrok, just with an complete different working principle. Or did I get it wrong?

And what do you mean with "_client would use SOREUSEADDR mode" (my english is really bad...)

jselbie commented 2 years ago

I had forgotten about the --reuseaddr option on the command line. In any case, it is not a good idea to to share a port with a different application serving up another protocol.