Tutorial TS3 Protocol

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
So as announced in a few threads, for those interested, here is the pretty much full TS3 protocol explained:
https://github.com/Splamy/TS3AudioBot/blob/master/TS3Client/ts3protocol.md

~Splamy

I have to give you a massive thanks for going through the effort of documenting and explaining the TS3 protocol. I know this was no game of hopscotch, you did some awesome research and documented it well. Do you feel a web-based TeamSpeak 3 client is feasible?

I have been doing some practicing and brainstorming ideas/ways one could carry out such a project.
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Well we are planning on making a rust implementation for the client (mostly for private use, but it will open source sooner or later). Rust being based on LLVM can be compiled to WebAssembly, so there's a chance this could maybe work. Our primary goal for now is to make a usable alternative to the normal ts3client with reasonable performance.
There are few apects I cant say anything about because I dont know enough:
- how custon audio input/output is handled in browers
- whether the performance of javascript is enough or webasm is needed.
- whether the required crypo libraries available for javascript
 

XRV-Webix

Member
May 2, 2016
111
55
64
This will be awesome if someone can build up a musicbot without the need of a teamspeak client.
I see the futur musicbots being less resource consumative and the ability to have multiple bots/streams with only 1 binary running.
I hope that can be something doable.
 

Najsr

Moderator
TeamSpeak Developer
Apr 23, 2016
483
249
167
Last edited:

Seebi

Member
Mar 9, 2016
1
2
35
Nice work! ;)

TeamSpeak uses a custom protocol over a UDP connection, so a completely web based client will probably never be possible as you are not allowed to send UDP packets from JavaScript.
You could build a relay/proxy though, that communicates with a TS server and browsers access it through WebRTC or WebSockets.
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
Nice work! ;)

TeamSpeak uses a custom protocol over a UDP connection, so a completely web based client will probably never be possible as you are not allowed to send UDP packets from JavaScript.
You could build a relay/proxy though, that communicates with a TS server and browsers access it through WebRTC or WebSockets.
https://stackoverflow.com/questions/18897917/does-webrtc-use-tcp-or-udp

I also suggest giving a look at https://github.com/Johni0702/mumble-web

My concern has nothing to do with UDP (despite yeah it being an ass stab), just that support for such a client could involve the proprietary software vendor throwing in bits of code into new server versions that make a project taking <insert_period_of_time> a pain in the ass to continue working. Basically what I mean is if TeamSpeak 3 staff for whatever reason dislike the web client, they could attempt to block web-based clients which would be a pain-in-the-ass to keep fighting back and forth. Tug-O-War between open source and proprietary. :cool:

I guess absolutely worst case scenario, one could derive from TeamSpeak 3 an entirely open source forked remake focusing on web/mobile client availability. People do this stuff with online games all the time (think private servers).

Aside from struggling with WebRTC, there is also https://gafferongames.com/post/why_cant_i_send_udp_packets_from_a_browser/ which details netcode being great for UDP --- https://github.com/networkprotocol/netcode.io

It may be possible to work out some type of browser plugin for secure VoIP connections (w/ netcode). Having such an option in the realm of open source would drive VoIP security forward quickly.
 
Last edited:

Wooozel

Active Member
Dec 8, 2015
17
8
78
i'll add some additions that are pretty interesting.
https://github.com/RedpointGames/netcode.io-browser
https://www.html5rocks.com/en/tutorials/webrtc/datachannels/
and take a look at the HTML5 SIP client
https://code.google.com/archive/p/sipml5/
(The protocol parsers (SIP, SDP...) are highly optimized using http://www.complang.org/ragel/ Ragel lookup tables and is suitable for embedded systems with limited memory and low computing power.) (sipML5 solution also contains webrtc2sip, click-to-call, webrtc4alland SIP TelePresence (Video Group chat) client components.)

btw as i know, google will have some interesting stuff we could need. some sneak peak: https://code.google.com/archive/p/google-voice-sipsorcery-dialplans/
 

Asphyxia

Owner
Administrator
Apr 25, 2015
1,845
2
2,199
327
We (the ReSpeak organization) will not do this and we also encourage other people not to do this for the reason described here: https://github.com/ReSpeak/tsclientlib#miscellaneous
I am tied between your thoughts and @Bluscream 's

While I agree releasing TeamSpeak 3 server source could be dangerous to TeamSpeak's economy, they really put this on themselves. TeamSpeak 3 operates like a reseller contract. They basically have the knives all ready to go but they get salesmen to go door-to-door and split a share. This is an old strategy and will not work forever. They need users running to their software, lining up by the thousands to use it happily.

Discord is competitive because their approach to moneymaking involved getting many investors. Discord acquired over $10,000,000 from investors in a short period of time. They originally planned to only sell stickers to make money. Instead, they offer a monthly subscription from users. TeamSpeak 3 too could use a similar method but it would be quite difficult to enforce server-side because Discord is a centralized technology whereas TeamSpeak 3 servers are hosted by users. Having a healthy open source alternative to TeamSpeak 3 would improve the security of VoIP but could pose business risk to TeamSpeak's company. This is a tough decision to make, so I certainly can see how Splamy is thinking.
 
Last edited:

Bluscream

Retired Staff
Contributor
May 8, 2015
967
934
211
Quick update, the whole hook works as plugin now, so it's as easy as installing the TS3Hook.ts3_plugin and starting Teamspeak with '-console'.
Also colors were added to easily see what messages are outgoing/incoming.

P.S. @Asphyxia Could you make a video tutorial/showcase for it?
 

Splamy

TeamSpeak Developer
Apr 26, 2016
72
101
71
Hey Splamy,

How looks that?
W2RiaDy.png
Looks fine, what is that for?
 
Top