Disclaimer:
This may work for you, and it may not. It's not a silver bullet, and you will still get 422's. No 'optimizations' are performed. All it does is globally limit the number of simultaneous connections to poloniex. It currently has the polo IP hard coded, so if it changes -- you gotta change it. It will redirect all local https requests to poloniex.
Requirements:
- 'nix server
- haproxy installed
- ability to edit hosts file
- port 443 available
Step 1: Setup haproxy
This is a barebones, no logging, no frills config.
global
maxconn 4096
user haproxy
group haproxy
pidfile /run/haproxy.pid
daemon
defaults
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 2000
timeout connect 10000
timeout server 50000
timeout client 50000
# Host HA-Proxy web stats on Port 3306 (that will confuse those script kiddies)
listen HAProxy-Statistics
bind :3306
mode http
option httplog
option httpclose
stats enable
stats uri /haproxy?stats
stats refresh 20s
stats show-node
stats show-legends
stats show-desc Workaround haproxy for SSL
stats auth admin:nimda
frontend ssl_relay
bind :443
mode tcp
option tcplog
option socket-stats
maxconn 5
default_backend ssl_polo
backend ssl_polo
mode tcp
option tcplog
balance roundrobin
hash-type consistent
server x_polo 104.20.12.48:443
- Change the stats auth <user>:<password> to your liking.
- If port 3306 isn't available for stats, change it to whatever you like
- Set maxconn to however many maximum simultaneous connections you want
You can view stats at: http://<yourserver>:3306/haproxy?stats
Step 2. Redirect polo requests
Edit your /etc/hosts file and append the following to the end
<haproxyIPAddress> poloniex.com
I'm sure there are some optimizations/tweaks, but it's a starting point.