You could use DNS to resolve the current IP your socket is connected. For redirects you'll have to use the ON SOCKREAD event and parse the results, extracting the redirect URL and open another socket to it or close the current socket and open another socket to it.