site_archiver@lists.apple.com Delivered-To: macnetworkprog@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=RB1OVLxlbzRSL0C320eY1j6lsmSqgA5/PHfjiA9ZnHU=; b=PQi6d25w n08iGNV67zXXPQ3IJAeOBlHWC505DqhpWlp40hu1vZdNcfioXOvX2DNezDi8WC3N ABvl2iCqodVCNu/tfYCh2MG2qbxQ3+b2VXRaLTSCENI9vi5Sd2hG2h68wW7pWvc8 mhuD1wfA9HulgTa76mgjMqPDAOInfOyQJjx9VlZFevnjrCeKd2egiEr2lkuK7Mmz BcuHBX1z/DKL8e4zaveXIayiwh8vQaxcqFH0BpK4dkVJsiSfd7+k3G1lT1QQPna8 sBAsdid66sdY4i3kBG/m1Eh1FLLW9VvbJqt9v+RvsaVO0HPSd98pXFmLC67fPCUO 5EqhHSrz1hRbbQ== My team’s analyzing a nasty issue where our network traffic sometimes gets mangled when the client is behind a tunneling HTTP proxy. * We call -[NSURLSession streamTaskWithHostName:port:] to open a TCP connection. * We send data in WebSocket format, first using CFHTTPMessage to generate/parse the handshake, then sending individual WebSocket messages. All data is written via -[NSURLSessionStreamTask writeData:completionHandler:]. This works perfectly in general, and is used in our shipping product. However, it fails when the (iOS) client is behind an HTTP proxy that supports the CONNECT method (tunneling). CFNetwork automatically sends the CONNECT request for us, so our code doesn’t have to deal with the proxy at all. However, at some point the server starts rejecting our WebSocket messages as invalid. Using WireShark we’ve figured out that the WebSocket messages are sometimes being sent to the (local) proxy in the wrong order. That is, the order in which our data blobs are passed to -writeData:completionHandler: is not alway the same order that the data blobs appear in the actual outgoing TCP stream. Again, this only happens when using a proxy. And there is zero change to our own code path when a proxy is present; we have no proxy-dependent code of our own, we just rely on NSURLSession to handle it. So we’re forced to conclude that something is going wrong inside CFNetwork. Has anyone seen anything like this? —Jens _______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (Macnetworkprog@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/macnetworkprog/site_archiver%40lists... This email sent to site_archiver@lists.apple.com