Hi Alec,

On Sat, Jun 01, 2019 at 05:39:30AM +0800, Alec Liu wrote:
> Hi Willy,
> 
> Thank you for merging it !
> 
> I have the merged code pull, and rerun some basic test, ends up failed.
> here is the testing configuration:
> * server Apache2_Via_SocksProxy_HTTP_SP 192.168.101.227:49980
> send-proxy verify none socks4 127.0.0.1:1080 check-via-socks4 check
> inter 30000 fastinter 1000
> 
> Looks like it is something related to the send and recv you have mentioned.
> Should we just leave it in this way for now, and wait for the issue to
> be fixed?

So I checked but I can't get it to fail here. In the trace below,
my SOCKS server (netcat+script) is on 127.0.0.1:9000 :

10:22:57.486347 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 8
10:22:57.486401 connect(8, {sa_family=AF_INET, sin_port=htons(9000), 
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EINPROGRESS (Operation now in 
progress)
10:22:57.486462 sendto(8, "\4\1\0P>\324r<HAProxy\0", 16, 
MSG_DONTWAIT|MSG_NOSIGNAL|MSG_MORE, NULL, 0) = 16
10:22:57.486481 recvfrom(8, 0x7ffd5106b7f8, 8, MSG_PEEK, NULL, NULL) = -1 
EAGAIN (Resource temporarily unavailable)
10:22:57.486493 epoll_ctl(3, EPOLL_CTL_ADD, 8, {EPOLLIN|EPOLLRDHUP, {u32=8, 
u64=8}}) = 0
10:22:57.692857 recvfrom(8, "\0Z\0\0\0\0\0\0", 8, MSG_PEEK, NULL, NULL) = 8
10:22:57.692948 recvfrom(8, "\0Z\0\0\0\0\0\0", 8, 0, NULL, NULL) = 8
10:22:57.693028 sendto(8, "OPTIONS / HTTP/1.0\r\n\r\n", 22, 
MSG_DONTWAIT|MSG_NOSIGNAL, NULL, 0) = 22
10:22:57.693142 recvfrom(8, 0x1df9bd0, 16384, 0, NULL, NULL) = -1 EAGAIN 
(Resource temporarily unavailable)
10:22:57.693197 epoll_ctl(3, EPOLL_CTL_MOD, 8, {EPOLLIN|EPOLLRDHUP, {u32=8, 
u64=8}}) = 0
10:22:57.693549 recvfrom(8, "HTTP/1.1 200 OK\r\n", 16384, 0, NULL, NULL) = 17
10:22:57.693631 recvfrom(8, 0x1df9be1, 16367, 0, NULL, NULL) = -1 EAGAIN 
(Resource temporarily unavailable)
10:22:57.693755 epoll_ctl(3, EPOLL_CTL_DEL, 8, 0x7fdcbd2c97e0) = 0
10:22:57.693921 close(8)                = 0
[WARNING] 152/102257 (29489) : Server 20080/srv is UP, reason: Layer7 check 
passed, code: 200, info: "OK", check duration: 207ms. 1 active and 0 backup 
servers online. 0 sessions requeued, 0 total in queue.
<29>Jun  2 10:22:57 haproxy[29489]: Server 20080/srv is UP, reason: Layer7 
check passed, code: 200, info: "OK", check duration: 207ms. 1 active and 0 
backup servers online. 0 sessions requeued, 0 total in queue.

It consumes the handshake, responds with the code you're expecting then
receives the reqeust and sends the response.

Oh I'm seeing that you're combining send-proxy with it so I guess you're
using the proxy protocol on top of the SOCKS connection, but don't have
check-send-proxy, thus there is no way the server will be able to respond.
Are you sure this isn't the cause of your problem ?

Willy

Reply via email to