Hello,
I am new to HAProxy and the Linux world. I would like to use HAProxy to route RDP connections. The routing should be based on the RDP cookie. But first, it should basically work. It is no problem to accept the connection and simply forward it. This configuration work, but RDP_COOKIE is always empty.
Sorry for the late reply. I use TSPlus. TSPlus accepts HTTPS and RDP connections simultaneously on port 443. I probably don’t understand HAProxy yet.
That won’t work. Not quite, the connection itself works, but the cookie should contain the name of the server to which the connection is to be made. However, the cookie is empty.
I think the problem is solved. There is no RDP cookie in TSPlus or HAProxy does not parse it because it is not the usual mstshash. But that’s not a problem because you can also check the payload directly. Then you have to keep two things in mind.
You definitely need a wait condition. Something like
if WAIT_END
if req.len ge XY
otherwise you check even though no data is available yet.
You must not try to read more than the data in the buffer with req.payload(0, XYZ). Then there is no return value. So either req.payload(0,0), which simply reads to the end, or a size that is definitely available.