# Receive TCP and forward as HTTP

**URL:** <https://discourse.haproxy.org/t/receive-tcp-and-forward-as-http/9051>\
**Category:** Help!\
**Created:** [September 20, 2023, 8:50pm UTC](https://discourse.haproxy.org/t/receive-tcp-and-forward-as-http/9051 "2023-09-20T20:50:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mattias](https://avatars.discourse-cdn.com/v4/letter/m/cab0a1/32.png) [@Mattias](https://discourse.haproxy.org/u/Mattias)\
**Post date:** [September 20, 2023, 8:50pm UTC](https://discourse.haproxy.org/t/receive-tcp-and-forward-as-http/9051/1 "2023-09-20T20:50:36Z")

</div>

I am trying to take a message (text string, JSON) over a TCP connection on port 8082 and forward it as an HTTP request to an apache server on port 80 (on the same machine). I think my configuration is not right since it is not working =)

**Conf:**  
frontend sample\_httpd  
bind \*:8082  
mode tcp  
default\_backend sample\_httpd  
option tcplog  
http-request set-method GET

backend sample\_httpd  
balance roundrobin  
mode http  
server master 127.0.0.1:80 check

**Log:**  
Sep 20 20:42:28 DR-tracktape haproxy[2147]: 185.205.225.36:42593 [20/Sep/2023:20:42:28.125] sample\_httpd sample\_httpd/master 1/0/500 0 – 1/1/0/0/0 0/0

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [September 21, 2023, 8:39am UTC](https://discourse.haproxy.org/t/receive-tcp-and-forward-as-http/9051/2 "2023-09-21T08:39:25Z")

</div>

You cannot.

You need to receive a HTTP in some form to be able to use HTTP.

Haproxy will not transform a non HTTP protocol into HTTP for you.
