Find the answer to your Linux question:
Results 1 to 3 of 3
I have a debian box running as a game server. The game runs on udp port 27960. I have a php script on a hosted web server to show the ...
  1. #1
    Just Joined!
    Join Date
    Jun 2008
    Location
    Memphis, TN
    Posts
    65

    Need help on redirecting port

    I have a debian box running as a game server. The game runs on udp port 27960. I have a php script on a hosted web server to show the server status. The problem is the host doesn't allow my php script to initiate udp connections. I can change the script to use tcp connections. I need help forwarding a tcp port to udp 27960. How would I do this? Also, would it cause any problems with the udp port?

    Thanks in advance!!!

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    Hello,

    tcp:27960 and udp:27960 are two separate ports, therefore the data does not interfere.

    I had the very same problem with my gameserver and webhost and I solved the problem with writing a small program that listens on TCP, queries the server local on UDP and sends the answer to the TCP. But unfortunately it is for a different game (OFP) which has a different query string so I am afraid this program won't help you for Q3A.

    If programming your own custom redirect tool is too difficult for you, you might want to look into the very powerful tool socat. I know it has the capabilities to do such a port bridging from TCP<-->UDP but it has 1001 command line options so it will take a while to browse the socat documentation. socat


    EDIT: I think you are lucky and I have found it out for you:
    socat TCP4-LISTEN:27960,reuseaddr,fork UDP:127.0.0.1:27960
    Debian GNU/Linux -- You know you want it.

  3. #3
    Just Joined!
    Join Date
    Jun 2008
    Location
    Memphis, TN
    Posts
    65
    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •