Saturday, June 30, 2012

TCPRelay 0.1.1 beta

Let me start this blog by talking about one of my simplest (and quite successful) projects: TCPRelay. This is a very simple program whose main purpose is to help users of XSplit (used to run my gaming stream) deal with some upload bandwidth issues. It started as a quick and dirty program that served as a relay between XSplit and the Twitch.tv server and became a nice little command-line tool that made a lot of people happy.

It works like this: while TCPRelay is running, it is listening to a TCP port in the local machine which is by default 1935. For every connection made to this port, a new connection will be made to the target server, the default being live.justin.tv:1935. Every byte TCPRelay receives on the local connection will be sent to the target server, and all responses made by the server will be transferred to the local connection. It is, in fact, a data relay, doing nothing but transferring data from one side to the other. XSplit users will have to go through the process of creating a custom connection to the local machine so as to make the program send and receive data through TCPRelay instead of connecting directly to the streaming servers. Some would call this a proxy, but it lacks the ability to dynamically choose the target server (which is impossible, given the network protocol used).

So now you are asking: how did this solve the upload bandwidth problem? The answer is something that eludes me and a few XSplit developers alike. Somehow, it works. I like to call it magic. See for yourself:

XSplit bandwidth test without TCPRelay

XSplit bandwidth test without TCPRelay

XSplit bandwidth test with TCPRelay

XSplit bandwidth test with TCPRelay

Amazing, huh? By the way, the game running behind it is StarCraft II: Wings of Liberty.

You can download version 0.1.1 beta (latest as of this writing) here. Also check out the official topic on XSplit's forums and see for yourself all the great feedback people gave me.

4 comments:

  1. any video to set up dis TCP relay? ty i really need it thank you

    ReplyDelete
  2. Hey, is there a way to use it for Youtube Live?

    ReplyDelete
  3. In theory, yes, but you need to find the RTMP URL and stream name/key for YouTube, which I couldn't find.

    Anyway, copy the URL into TCPRelay. In XSplit, copy the stream name/key into the respective field. The RTMP URL must be changed: replace "app" with anything that comes after the first single forward slash (known as the URL path) from the YouTube RTMP URL.

    ReplyDelete
  4. By the way, the most recent version of TCPRelay is 0.3 alpha 3 (or, if you prefer not to use an alpha version, grab 0.2.2.3 beta).

    ReplyDelete