• Welcome to Valhalla Legends Archive.
 

UDP to TCP proxy?

Started by ThePro, November 17, 2006, 04:54 PM

Previous topic - Next topic

ThePro

Hello!
I have Internetaccess in my University but I can't play Starcraft there, cuz the stupid admins blocked the UDP ports. I can join bnet but I get a Plug behind my name. :(

Now I got the Idea to code a Proxy tool, which sends the UDP packets of Bnet as TCP to my homecomputer which sends them as UDP to bnet.
I'd run that tool as Server on port 6112 on my Notebook and let Starcraft connect there.

Starcraft TCP > Proxy tool > Homecomputer > Bnet
Starcraft UDP > Proxy tool (Convert to TCP) > Homecomputer (Reconvert to UDP) > Bnet

Is that possible?
I know that TCP is much slower than UDP but the Traffic is about 1,5Kb/s so it should be no problem.

Skywing

It would probably be much simpler to just use a full VPN for this.

This forum is probably not the right location for such a discussion.

l2k-Shadow

Just keep in mind you'd have to make several TCP sockets to handle this and create a new connection for each IP that sends to the UDP port.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

ThePro

Yes I know.
First I will analyse this UDP stuff.

If there is any interest I'd public the proxy tool here wehen it's done.

Ringo

Just use a socks server?
The 2nd byte into the login packet, is a protocol identification byte, 1 for a TCP connection, 2 for UDP Bind. (google will help here)
Iv persionaly never used a socks server for UDP, so im not exacly sure how you specify the address of the destination, when sending data.

What i would persinaly do, as long as your school enables UDP across the network, is write a socks server for your home PC, and a gateway for the school pc+starcraft.
That way, your gateway program can *network* all the udp data to your home pc's socks server, via a TCP connection.
Example, sending 8 bytes to the socks server infront of every udp message with the port/ip/message lengh, so that your socks server can buffer split TCP messages, as well as faward the message payload to the correct address/port.

Its easy in princible, hard in practiss :)

NetNX

Quote from: Ringo on November 19, 2006, 05:04 AM
Just use a socks server?
The 2nd byte into the login packet, is a protocol identification byte, 1 for a TCP connection, 2 for UDP Bind. (google will help here)
Iv persionaly never used a socks server for UDP, so im not exacly sure how you specify the address of the destination, when sending data.

What i would persinaly do, as long as your school enables UDP across the network, is write a socks server for your home PC, and a gateway for the school pc+starcraft.
That way, your gateway program can *network* all the udp data to your home pc's socks server, via a TCP connection.
Example, sending 8 bytes to the socks server infront of every udp message with the port/ip/message lengh, so that your socks server can buffer split TCP messages, as well as faward the message payload to the correct address/port.

Its easy in princible, hard in practiss :)

I belive that you can actually use a Socks5 server with SocksCap to do this. IRCC UDP is supported.

TheMinistered

Well, skywing, I have to disagree.  This is general programming and he is talking about writing a small program to provide a service.  I would consider this general programming, maybe you don't. 

At any rate, yes this should do the trick if you want to use your own tool for simplicity (bare minimum, no extra "cool" features, no bulkware/adware, etc).

Your idea sounds perfectly sound to me, why not get started?  Should only take you an hour or two to get it up and running.  The only concern I might have is with connection lag, but thats up to you to deal with.

Skywing

Quote from: TheMinistered on January 03, 2007, 10:07 AM
Well, skywing, I have to disagree.  This is general programming and he is talking about writing a small program to provide a service.  I would consider this general programming, maybe you don't. 
This thread originated in the wrong forum and was eventually moved to this forum.

Banana fanna fo fanna

ehhh i dunno about "an hour or two"
he's going to have to spoof the origin address of the udp packets being sent to the bnet client, which (probably) requires the use of raw sockets.

Joe[x86]

Quote from: l2k-Shadow on November 17, 2006, 06:07 PM
Just keep in mind you'd have to make several TCP sockets to handle this and create a new connection for each IP that sends to the UDP port.

Not necessarily. If the two TCP endpoints will both be in software he has written, he's in full control of it. It's entirely possible for him to include a header that states what IP the packet came from.

Quote from: Banana fanna fo fanna on January 03, 2007, 11:35 PM
ehhh i dunno about "an hour or two"
he's going to have to spoof the origin address of the udp packets being sent to the bnet client, which (probably) requires the use of raw sockets.

Not necessarily. He could go all out with this and tunnel the Battle.net <-> Client TCP channel through the proxy as well (even along the same socket, as described above!), making Battle.net think that the game is physically being played at his house.
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

A2

Quote from: Ringo on November 19, 2006, 05:04 AM
Just use a socks server?
The 2nd byte into the login packet, is a protocol identification byte, 1 for a TCP connection, 2 for UDP Bind. (google will help here)
Iv persionaly never used a socks server for UDP, so im not exacly sure how you specify the address of the destination, when sending data.

What i would persinaly do, as long as your school enables UDP across the network, is write a socks server for your home PC, and a gateway for the school pc+starcraft.
That way, your gateway program can *network* all the udp data to your home pc's socks server, via a TCP connection.
Example, sending 8 bytes to the socks server infront of every udp message with the port/ip/message lengh, so that your socks server can buffer split TCP messages, as well as faward the message payload to the correct address/port.

Its easy in princible, hard in practiss :)

note: this functionality is absent in socks4 (never std'd afaik)