beginner10 Posted September 22, 2021 Share Posted September 22, 2021 (edited) Hi, Does anyone know how I can set the correct proxy in this script? Thank you Func _MicrosoftXMLHTTP($url) $oHttp = ObjCreate("Microsoft.XMLHTTP") ;$oHttp.setProxy(2, "209.127.191.111:9279") ;$oHttp.setProxyCredentials("user", "pass") $oHttp.Open("GET", $url, 0) $oHttp.Send() If @error Then Return SetError(1, 0, 0) $sReceived = $oHttp.ResponseText Return $sReceived EndFunc ;==>_MicrosoftXMLHTTP Edited September 22, 2021 by beginner10 Link to comment Share on other sites More sharing options...
Zedna Posted September 22, 2021 Share Posted September 22, 2021 (edited) Use WinHttpRequest: $o_http = ObjCreate("winhttp.winhttprequest.5.1") If $ini_proxy <> '' Then $o_http.SetProxy($HTTPREQUEST_PROXYSETTING_PROXY, $ini_proxy, "") ; 209.127.191.111:9279 If $ini_proxy_name <> '' Then $o_http.SetCredentials($ini_proxy_name, $ini_proxy_pwd, $HTTPREQUEST_SETCREDENTIALS_FOR_PROXY) EndIf $o_HTTP.Open('GET', $url, False) $o_HTTP.Send() ;If $o_HTTP.Status <> '200' Then ... $ret = $o_HTTP.Responsetext Global Const $HTTPREQUEST_PROXYSETTING_DEFAULT = 0 Global Const $HTTPREQUEST_PROXYSETTING_PRECONFIG = 0 Global Const $HTTPREQUEST_PROXYSETTING_DIRECT = 1 Global Const $HTTPREQUEST_PROXYSETTING_PROXY = 2 Global Const $HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0 Global Const $HTTPREQUEST_SETCREDENTIALS_FOR_PROXY = 1 Edited September 22, 2021 by Zedna beginner10 1 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now