Forum Discussion
jdscrymgeour_42
Jan 10, 2012Nimbostratus
The system I am using is very bespoke, the BIGIP receives a TCP packet and forwards the payload as UDP to a device and waits for a response to the request, the device then sends a UDP message back and I use the recv command for and then a TCP_respond with the data back to the client.
I have removed some debug and additional checks I run on the message but below is my basic rule,
sen
when RULE_INIT {
set ::DEBUG 0
}
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set DATA [ TCP::payload]
TCP::payload replace 0 [TCP::payload length] " "
if { $::DEBUG > 2 }{log local0. " HIGH OUT= :$DATA:"}
regsub -all {[ ]+} $DATA "" DATA2
set conn [connect -protocol UDP -status conn_status -idle 10000 -timeout 10000 172.31.2.2:49602]
set send_info [send -status send_status $conn $DATA2]
Setup RX connection, wait for response then reply to client
}
set recv_data [ recv -peek -eol -timeout 200 -status recv_status 18 $conn]
}
close $conn
TCP::respond "$recv_data\r\n"
unset recv_data
}
}
}