# Option to make Connect Proxy work with HTTP traffic?

**URL:** <https://forums.swift.org/t/option-to-make-connect-proxy-work-with-http-traffic/49737>\
**Category:** SwiftNIO\
**Created:** [June 18, 2021, 1:56pm UTC](https://forums.swift.org/t/option-to-make-connect-proxy-work-with-http-traffic/49737 "2021-06-18T13:56:51Z")\
**Posts on this page:** 1\
**Showing post:** 36

<div class="post-metadata">

**Author:** ![lukasa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukasa/32/1232_2.png) [@lukasa](https://forums.swift.org/u/lukasa)\
**Post date:** [June 28, 2021, 10:06am UTC](https://forums.swift.org/t/option-to-make-connect-proxy-work-with-http-traffic/49737/36 "2021-06-28T10:06:48Z")

</div>

> [@nemecek\_f](#):
>
> That makes sense, are you sure I need to add the `HTTPResponseDecoder` because this does not work, since this does not conform to the ChannelHandler protocol.

`HTTPResponseDecoder` is wrapped in `ByteToMessageHandler`.

Concretely, we need to discuss what is happening here.

Your server channel is reading data from the network and decoding the data into `HTTPServerRequestPart`. The problem you have is that you need to transform these into `HTTPClientRequestPart` for the `HTTPRequestEncoder` to tolerate it (that's what the type mismatch you saw above was). You can do this my modifying your proxy handler to change its `InboundOut` type to `HTTPClientRequestPart`. In general this won't be a problem, but you will need to wrap each of your `.body` payloads in `.body(.byteBuffer())`.

---

_[View the full topic](https://forums.swift.org/t/option-to-make-connect-proxy-work-with-http-traffic/49737)._
