Simple haproxy Setup

I’m a bit confused about how I might be able to set up a raspberry pi as a simple http proxy on top of Balena. On a raw pi, I’ve figured out how to disallow a gateway and bind port eth0 to the subnet/address I’m trying to proxy too, but I’m not clear on how I might allow the same operation with Balena in the mix.

The steps I take with a vanilla Pi are as follows:

  1. create a wpa_supplicant.conf file to allow for headless wifi adoption on first boot (this shouldn’t be necessary if I use a Balena image with wifi & ethernet, correct?).

  2. Update the OS and install haproxy (pretty sure I can cobble this together)

  3. Modify dhcpcd.conf to disable gateway (this is where I’m getting hung up)

  4. Update the haproxy config for my purposes (also pretty sure I can cobble this together)

Thanks for the help!

You could start with the projects we use at balena for this:
https://github.com/balena-io/open-balena-haproxy

A composition containing both will allow you to configure WiFi networking on a device via a browser/smartphone (via local temporary hotspot).

You’ll need to craft your own haproxy.conf, building on the empty one given in the repository.

I am not sure what is the purpose of disabling gateway - without a default gateway, the device has no network. A default gateway will be supplied by the WiFi AP you join to using wifi-connect bootstrap.