Http_proxy when moving from lxd 2 to lxd 3

LXD 3.0 still supports that proxy configuration for IPv6 that you had in LXD 2.0.
You do not need to enable in /etc/default/lxd-bridge , but as in

$ lxc config set mycontainer environment.http_proxy http://[fe80::1%eth0]:13128

That only sets the environment variable in the container. Nothing responds on [fe80::1%eth0] - I cannot even ping it - so setting the http_proxy environment variable pointing to that address doesn’t achieve anything useful.

Having said that, you can still use the proxy device to provide proxy access to the container while at the same time avoid configuring the networking for those containers. For this to work, you would need to setup yourself a proxy on the host. Then, use a TCP proxy device to forward from the container’s port 3128 to the host’s proxy port.

OK, that’s more or less what I said. This implies what I would need is something like:

$ lxc config set mycontainer environment.http_proxy http://127.0.0.1:13128

plus

$ lxc config device add mycontainer http proxy listen=tcp:127.0.0.1:13128 connect=tcp:x.x.x.x:13128  ## ?

(Aside: I can’t see how “proxy listen… connect…” decides whether to listen inside the container and connect from the host, or vice versa. What if the listen and connect addresses are both 127.0.0.1?)

And then also run a http proxy on the host.

Update: after more searching I found that lxd 3.3 has a proxy_protocol flag. However this doesn’t enable a HTTP proxy; rather it adds a HAproxy ‘PROXY protocol’ message to the start of the TCP stream, to relay the original source IP address.