If you mean http proxy, look at
https://github.com/koreader/koreader...nager.lua#L627
Unfortunately there's no way to retrieve the gateway ip. You'll need some platform dependant code in your patch. On plain linux you can parse /proc/net/route or use ip or route tools. I don't know much about the kindle.