restructure socks server library