This is a simple web application to proxy HTTP traffic to a Kafka cluster.
It exposes a /publish
route
that you can POST
a Kafka message to.
The payload to POST
is:
interface PublishData {
topic: string;
message: string; // a JSON stringified string of your message
}
An Authentication
header must be present otherwise all requests will be rejected.
The auth token can be set via the AUTH_TOKEN
key in the env file.
- install cross
- run
cross build --release --target x86_64-unknown-linux-gnu
- Upload compiled binary to the internet
cd /home
curl -o kafka-proxy <uploaded_file_url>
chmod +x kafka-proxy
- make a systemd service and start it :)