trancexx Posted November 28, 2010 Author Share Posted November 28, 2010 Of course. Usually that's done by saving it to a file and manually setting when needed. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
toby9999 Posted November 28, 2010 Share Posted November 28, 2010 Hello I can set the WinHTTP proxy settings using _WinHttpSetDefaultProxyConfiguration($WINHTTP_ACCESS_TYPE_NAMED_PROXY, $sProxyName, $sProxyBypass) - this is the same as the netsh command "netsh winhttp set proxy ..." However, I can't find a way to programmatically reset the proxy (ie set NO proxy) - the netsh command is "netsh winhttp reset proxy". I have tried _WinHttpSetDefaultProxyConfiguration($WINHTTP_ACCESS_TYPE_NO_PROXY, "", "") and _WinHttpSetDefaultProxyConfiguration($WINHTTP_ACCESS_TYPE_DEFAULT_PROXY, "", "") but it always fails with error: "The parameter is incorrect." I have looked everywhere for one example of how to set "no proxy" using the winhttp api, but I can only find examples of how to set "a proxy". Any ideas? Thanks! Cheers Toby Link to comment Share on other sites More sharing options...
cypher175 Posted November 29, 2010 Share Posted November 29, 2010 is there anyway to share a cookie from a login amung multiple au3.exe processes using these HTTP UDF functions..? Of course. Usually that's done by saving it to a file and manually setting when needed.Mind showing me an example of how to do that please..?? Link to comment Share on other sites More sharing options...
trancexx Posted December 1, 2010 Author Share Posted December 1, 2010 Mind showing me an example of how to do that please..??Normally I wouldn't. Mind, that is. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
cypher175 Posted December 1, 2010 Share Posted December 1, 2010 Normally I wouldn't. Mind, that is.so you dont want to show me an example then..could you please point me to where I might find an example then..? Link to comment Share on other sites More sharing options...
trancexx Posted December 1, 2010 Author Share Posted December 1, 2010 It's in my head and I guess that's not helping much, right? Try writing something. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
cypher175 Posted December 1, 2010 Share Posted December 1, 2010 eh, has it to do anything with setting it in the request headers at all..? like: Cookie: PHPSESSID=45t4534535f4f54; Link to comment Share on other sites More sharing options...
toby9999 Posted December 3, 2010 Share Posted December 3, 2010 Hello I recently posted asking about the _WinHttpSetDefaultProxyConfiguration function. I didn't receive any replies, so I assume no one knows the answer. But just in case I wasn't clear in my question, I thought I'd try again with a related question... (sorry to be kinda posting twice) Can someone please tell me what the acceptable/correct parameters are for the _WinHttpSetDefaultProxyConfiguration function, as I keep getting the error: "The parameter is incorrect." Thanks. Link to comment Share on other sites More sharing options...
trancexx Posted December 3, 2010 Author Share Posted December 3, 2010 (edited) Hello I recently posted asking about the _WinHttpSetDefaultProxyConfiguration function. I didn't receive any replies, so I assume no one knows the answer. But just in case I wasn't clear in my question, I thought I'd try again with a related question... (sorry to be kinda posting twice) Can someone please tell me what the acceptable/correct parameters are for the _WinHttpSetDefaultProxyConfiguration function, as I keep getting the error: "The parameter is incorrect." Thanks. It's my fault. I haven't anticipated all possible scenarios for calling that function. That's why there is no example for it in the help file. To reset proxy call that function like this: _WinHttpSetDefaultProxyConfiguration($WINHTTP_ACCESS_TYPE_NO_PROXY) But not until you replace it with this function: Func _WinHttpSetDefaultProxyConfiguration($iAccessType, $sProxy = "", $sProxyBypass = "") Local $tProxy = DllStructCreate("wchar[" & StringLen($sProxy) + 1 & "]") DllStructSetData($tProxy, 1, $sProxy) Local $tProxyBypass = DllStructCreate("wchar[" & StringLen($sProxyBypass) + 1 & "]") DllStructSetData($tProxyBypass, 1, $sProxyBypass) Local $tWINHTTP_PROXY_INFO = DllStructCreate("dword AccessType;" & _ "ptr Proxy;" & _ "ptr ProxyBypass") DllStructSetData($tWINHTTP_PROXY_INFO, "AccessType", $iAccessType) If $iAccessType <> $WINHTTP_ACCESS_TYPE_NO_PROXY Then DllStructSetData($tWINHTTP_PROXY_INFO, "Proxy", DllStructGetPtr($tProxy)) DllStructSetData($tWINHTTP_PROXY_INFO, "ProxyBypass", DllStructGetPtr($tProxyBypass)) EndIf Local $aCall = DllCall($hWINHTTPDLL__WINHTTP, "bool", "WinHttpSetDefaultProxyConfiguration", "ptr", DllStructGetPtr($tWINHTTP_PROXY_INFO)) If @error Or Not $aCall[0] Then Return SetError(1, 0, 0) Return 1 EndFunc Edited December 3, 2010 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
cypher175 Posted December 16, 2010 Share Posted December 16, 2010 (edited) how would you set a USERNAME & PASSWORD for a Proxy using this HTTP UDF..? figured it out.. _WinHttpSetCredentials($hRequest, $WINHTTP_AUTH_TARGET_PROXY, $WINHTTP_AUTH_SCHEME_BASIC, "USER", "PASS") Edited December 17, 2010 by cypher175 Link to comment Share on other sites More sharing options...
cypher175 Posted December 17, 2010 Share Posted December 17, 2010 OK so I am able to use an HTTP Proxy ok with this UDF, but now i'm having a problem with the "Proxy-Connection: Close" How do I change it to "Proxy-Connection: Keep-Alive"..? I tried setting it in the request headers but that doesn't seem to work for some reason, is there some other way of doing it to keep the proxy connection alive..? Link to comment Share on other sites More sharing options...
spymare Posted December 17, 2010 Share Posted December 17, 2010 hi my script looks like this: #include "WinHttp.au3" Global Const $sAddress = "dbq.dk" $1 = (@scriptdir & "\1.txt") Global $hOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hOpen, $sAddress) Global $sHTM = _WinHttpSimpleFormFill($hConnect, Default, Default, "name:ufile", $1) ;upload 1 _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) it only works with no subdomain :S. so if i create a new folder on dbq.dk called: dbq.dk/test and put my php script inside the test folder, and make the script with this: Global Const $sAddress = "dbq.dk/test" it won't work :/, can someone help me ? Link to comment Share on other sites More sharing options...
trancexx Posted December 17, 2010 Author Share Posted December 17, 2010 (edited) hi my script looks like this: #include "WinHttp.au3" Global Const $sAddress = "dbq.dk" $1 = (@scriptdir & "\1.txt") Global $hOpen = _WinHttpOpen() Global $hConnect = _WinHttpConnect($hOpen, $sAddress) Global $sHTM = _WinHttpSimpleFormFill($hConnect, Default, Default, "name:ufile", $1) ;upload 1 _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) it only works with no subdomain :S. so if i create a new folder on dbq.dk called: dbq.dk/test and put my php script inside the test folder, and make the script with this: Global Const $sAddress = "dbq.dk/test" it won't work :/, can someone help me ? Of course it won't work. Read the documentation for that function (parameters). Link for your convenience. @cypher175, show me the code. Edited December 17, 2010 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
cypher175 Posted December 17, 2010 Share Posted December 17, 2010 Im pretty sure it was the remote server that was closing the "Proxy-Connection: Keep-Alive" setting, because I tried the same proxy in FireFox on the same remote server and the HTTP Headers were the same, the remote server closed the proxy connection after it was established even though firefox's "proxy-keep-alive" settings were set to true.. Is there anyway to use SOCKS5 Proxies with this WinHTTP UDF or are HTTP Proxies only supported..? Link to comment Share on other sites More sharing options...
trancexx Posted December 17, 2010 Author Share Posted December 17, 2010 That's WinHTTP question. Microsoft to ask. No SOCKS. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
spymare Posted December 21, 2010 Share Posted December 21, 2010 i tryed using the helpfile, i can't get it to work using a subdomain :/ Link to comment Share on other sites More sharing options...
trancexx Posted December 21, 2010 Author Share Posted December 21, 2010 i tryed using the helpfile, i can't get it to work using a subdomain :/Ok, thank you for sharing that information.Find some AutoIt wiki tutorial for beginners. When you learn the basics you will have no problem with this. I believe Melba23 (he's around) have useful links in his sig. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
spymare Posted December 21, 2010 Share Posted December 21, 2010 never mind got it work. Link to comment Share on other sites More sharing options...
dthongvl Posted December 22, 2010 Share Posted December 22, 2010 (edited) Can I Use This UDF with Https Protocol ? Thanks EveryOne Edited December 22, 2010 by dthongvl Link to comment Share on other sites More sharing options...
trancexx Posted December 22, 2010 Author Share Posted December 22, 2010 Can I Use This UDF with Https Protocol ? Thanks EveryOneYes, you have my permission. ...I don't know about ProgAndy though. Send him PM or dozen maybe asking that. ♡♡♡ . eMyvnE 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