I have a legacy system that can return raw\plain HTTP responses as a string (text that contains all the required headers + body).
I would like to send this text directly without any parsing modifications for performance reasons.
So goal is to proxy received raw HTTP response.
const express = require('express');
const app = express();
const router = app.Router();
router.get('request',()=>{
const plainTextWithHeadersFromExternalSystem = `HTTP/1.1 200 OK
Date: Sun, 10 Oct 2010 23:26:07 GMT
Server: Apache/2.2.8 (Ubuntu) mod_ssl/2.2.8
OpenSSL/0.9.8g
Last-Modified: Sun, 26 Sep 2010 22:04:35 GMT
ETag: "45b6-834-49130cc1182c0"
Accept-Ranges: bytes
Content-Length: 12
Connection: close
Content-Type: text/html
Hello world!`;
... TODO: send text with headers and body as a response.
});
It can be any content type, not only a plain text.
Any ideas whether it's possible to simply proxy it with the Node.js express lib?