How to set WIFI proxy via adb shell? Genymotion 2.2 &amp; Android 4.0

I want to set a global HTTP proxy in Android, and all Apps will go through this proxy.

Now I can only do this in GUI as following way: Wi-Fi -> WiredSSID -> Modify Network -> show advanced options

Is there any way to set the WIFI proxy via adb shell?

I've Googled and tried several ways such as:

 1. export http_proxy xxx
 2. setprop net.gprs.http-proxy xxx
 3. sqlite3 /data/data/com.android.providers.settings/databases/settings.db; INSERT INTO system VALUES(99,'http_proxy','xxx.xxx.xxx.xxx:xxxx')


and nothing worked.
On my Android 7 and 8 devices:

adb shell settings put global http_proxy &lt;address&gt;:&lt;port&gt;


Seems the setting is lost at reboot, however.