即使关闭了代理并清除了Cookie,IP鸡如何记住我的代理IP地址?我怎么做到第二次访问ipchicken它显示没有代理的IP?
require 'socksify'
require 'mechanize'
agent = Mechanize.new
#port forwarding set up on port 9999
TCPSocket::socks_server = 'localhost'
TCPSocket::socks_port = 9999
p agent.get("http://www.ipchicken.com").text #IP SHOWS PROXY IP
p agent.cookie_jar.jar #SHOWS IPCHICKEN COOKIE
agent.cookie_jar.clear!
p agent.cookie_jar.jar #SHOWS NO COOKIES
TCPSocket::socks_server = nil
TCPSocket::socks_port = nil
p agent.get("http://www.ipchicken.com").text #SHOWS PROXY IP
p agent.get("http://www.whatismyipaddress.com").text #SHOWS IP WITH NO PROXY