3

I am using socat for windows as a client to tunnel DNS over SSH, it works perfectly until the ssh connection dies or becomes temporarily unavailable - when this happens the socat windows client terminates and requires restarting.

I am using the following command on windows client:

socat -s udp-recvfrom:53,reuseaddr,bind=127.0.0.1,fork tcp:127.0.0.1:5377

Does anyone know a way to prevent the socat client from quitting when the ssh connection becomes unavailable? The help file suggests the -s switch solves this but it doesn't.

Pavan Manjunath
  • 27,404
  • 12
  • 99
  • 125
Kyoku
  • 182
  • 1
  • 4
  • 13
  • You could wrap the command with an [infinite loop](http://stackoverflow.com/questions/5487473/how-to-create-an-infinite-loop-in-windows-batch-file). – C2H5OH Apr 02 '12 at 18:56
  • Not sure how to create an infinite loop - I'm running the command from a compiled vbscript with WshShell.Run "socat.exe -s udp-recvfrom:53,reuseaddr,bind=127.0.0.1,fork tcp:127.0.0.1:5377",0,false – Kyoku Apr 02 '12 at 19:26

1 Answers1

2

Following your comment, a loop in VBScript (what Windows Scripting Host uses) is easier:

Do
    WshShell.Run "socat.exe -s udp-recvfrom:53,reuseaddr,bind=127.0.0.1,fork tcp:127.0.0.1:5377",0,True
Loop While True
C2H5OH
  • 5,452
  • 2
  • 27
  • 39