
stalliont
Members-
Posts
11 -
Joined
-
Last visited
Everything posted by stalliont
-
hi ripdad, thanks for answering my queries. I got the autenticate working, connecting thru my corporate proxy using http, but https would not work, getting an error bad request. Things getting a little more technical trying to find out how my corporate proxy works handling https Here is an example log connect to https://www.yahoo.com, as what you are saying that you are probably right about my corporate proxy handling https connection differently not 1 on 1 passthru. ] HTTP Proxy listening on IP :10.44.27.36 Port :8081 ] HTTPS Proxy listening on IP :10.44.27.36 Port :8082 ] new HTTPS clientconnection :10.44.27.36 ] Added new client to mainarray , pos: 1 ] Client 1 requested CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 ]1 Proxy Server : CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 ]1 Connected to Host: CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 ] modifying :1 CONNECT www.yahoo.com:443 HTTP/1.1 -> to :CONNECT www.yahoo.com:443 HTTP/1.1 ] modifying :2 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 -> to :User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 ] modifying :3 Proxy-Connection: keep-alive -> to :Proxy-Connection: keep-alive ] modifying :4 Connection: keep-alive -> to :Connection: keep-alive ] modifying :5 Host: www.yahoo.com:443 -> to :Host: www.yahoo.com:443 ] modifying :6 -> to : ] Request modified to: CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 Proxy-Authorization: Basic ZmFsXHRyYW5sOiFwaXNzb2ZmOTkh ] Client 1 requested 0x16030100AF010000AB03030104FAE2AEAF84659D21029E3DA34074AE396AFE653FC6809FE294A1E2D02A0000002EC02BC02FC00AC009C013C014C012C007C0110033003200450039003800880016002F004100350084000A000500040100005400000012001000000D7777772E7961686F6F2E636F6DFF01000100000A00080006001700180019000B000201000023000033740000000500050100000000000D0012001004010501020104030503020304020202 0x16030100AF010000AB03030104FAE2AEAF84659D21029E3DA34074AE396AFE653FC6809FE294A1E2D02A0000002EC02BC02FC00AC009C013C014C012C007C0110033003200450039003800880016002F004100350084000A000500040100005400000012001000000D7777772E7961686F6F2E636F6DFF01000100000A00080006001700180019000B000201000023000033740000000500050100000000000D0012001004010501020104030503020304020202 ]1 Sending HTTP to Host CONNECT www.yahoo.com:443 HTTP/1.1 User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:32.0) Gecko/20100101 Firefox/32.0 Proxy-Connection: keep-alive Connection: keep-alive Host: www.yahoo.com:443 successfull prevlen:362 now:362 ]1 Got Host response ]1 Sent data to Client HTTP/1.1 400 Bad Request ( The data is invalid. ) Via: 1.1 SYD0364 Connection: close Proxy-Connection: close Pragma: no-cache Cache-Control: no-cache Content-Type: text/html Content-Length: 615 I think I just play around and do my codes with http connection, and troubleshoot https on the other thread for 'autoit proxy server', but i like your continued work with the local proxy server, and the TCP Passive Proxy Filter, these are great alternatives...
- 34 replies
-
- url filter
- blacklist
-
(and 3 more)
Tagged with:
-
hi ripdad, thanks for quick reply. I am trying to setup this local proxy under coorporate network and the only way to get to internet is through this proxy. Once i can get this working. Then my next step to run on a server with set commands for user can choose for automated reporting as we have different external websites that need to get source data for manipulation. Ah 'Base64 Encoded login' you mentioned might be the culprit. I might starting checking which encode type login the proxy is using could fix my problem. It could be better to have this with your version of proxy server as its so simple and clean.
- 34 replies
-
- url filter
- blacklist
-
(and 3 more)
Tagged with:
-
Can you help, add a feature to connect over another proxy? I tried the modified version posted by Ka36ek at '?do=embed' frameborder='0' data-embedContent>>. After found the Base64.au3 to included. I got it to authenticated successfully on the other proxy server but returned blank display on internet explorer or firefox. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=proxy.exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** TCPStartup() #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <GUIEdit.au3> #Include <Array.au3> #Include <File.au3> #include <WindowsConstants.au3> #include <Base64.au3> Opt("GUIOnEventMode" , 1) Opt("TrayAutoPause",0) Opt("TrayMenuMode",3) Opt("TrayOnEventMode",1) Global $ini = @ScriptDir & "\config.ini" Global $mainarray[30][10] Global $proxysocket , $proxysocketssl Global $GUISHOW = 1 Global $FUseProxy = False Global $SProxyAuthCode = "" ; ???????? ????? ? ??? $mainarray[0][0] = "Hostport" $mainarray[0][1] = "Clientsocket" $mainarray[0][2] = "Hostsocket" $mainarray[0][3] = "Request" $mainarray[0][4] = "Hostname" $mainarray[0][5] = "Timerhandle connection" $mainarray[0][6] = "Blocked" $mainarray[0][7] = "State" $mainarray[0][8] = "connection type" $mainarray[0][9] = "req count" Global $gui = GUICreate("ProxyServer v0.2",700,700) $DEBUG=GUICtrlCreateEdit("" , 5 , 30 , 500 ,670,BitOr($GUI_SS_DEFAULT_EDIT,$ES_READONLY)) GUICtrlSetLimit(-1 , 2000000000000000) Global $button_debug_clear = GUICtrlCreateButton("Clear",5,5,90,20) GUICtrlSetOnEvent($button_debug_clear,"_debug_clear") GUICtrlCreateLabel("Listening IP:",515,40,70,20) GUICtrlCreateLabel("Port HTTP:",515,60,70,20) GUICtrlCreateLabel("Port HTTPS:",515,80,70,20) Global $input_proxyip = GUICtrlCreateInput("",590, 40,100,20) Global $input_proxyport = GUICtrlCreateInput("",590,60,60,20) Global $input_proxyportssl = GUICtrlCreateInput("",590,80,60,20) Global $button_proxy_save = GUICtrlCreateButton("Save and Restart",515,140,180,20) GUICtrlSetOnEvent($button_proxy_save,"_mainsocket_save") Global $checkbox_debug = GUICtrlCreateCheckbox("Debugmode", 515 , 240, 120, 20) Global $checkbox_debug_save = GUICtrlCreateCheckbox("Save Debug to file", 515 , 260, 120, 20) Global $checkbox_debug_content = GUICtrlCreateCheckbox("Show traffic content", 515 , 280, 120, 20) Global $button_debug_content = GUICtrlCreateButton("Binary to String",515,320,120,19) GUICtrlSetOnEvent($button_debug_content,"_debug_binary") Global $button_debug_array = GUICtrlCreateButton("show mainarray",515,340,120,19) GUICtrlSetOnEvent(-1,"_show_array") #Region ### START Koda GUI section ### Global $Proxy_Form = GUICreate("Settings", 209, 190, 192, 132) Global $PF_IP = GUICtrlCreateInput("", 8, 24, 121, 24) Global $PF_Port = GUICtrlCreateInput("", 136, 24, 57, 24) Global $PF_Login = GUICtrlCreateInput("", 88, 65, 105, 24) Global $PF_Pass = GUICtrlCreateInput("", 88, 96, 105, 24) Global $PF_OK = GUICtrlCreateButton("OK", 8, 152, 89, 25, 0) GUICtrlSetOnEvent($PF_OK,"_close_proxy_settings") Global $PF_Save = GUICtrlCreateButton("Save", 104, 152, 89, 25, 0) GUICtrlSetOnEvent($PF_Save,"_save_proxy_settings") GUICtrlCreateLabel("Pass", 16, 100, 54, 20) GUICtrlCreateLabel("Username", 16, 65, 33, 20) GUICtrlCreateLabel("IP Address", 16, 3, 80, 20) GUICtrlCreateLabel("Port", 136, 3, 39, 20) Global $PF_CheckboxUse = GUICtrlCreateCheckbox("PF_Use", 16, 128, 137, 17) GUISetState(@SW_HIDE, $Proxy_Form) #EndRegion ### END Koda GUI section ### GUISetOnEvent($GUI_EVENT_CLOSE,"_quit") Global $tray_showgui = TrayCreateItem("Show gui") Global $tray_showproxyform = TrayCreateItem("????????? ??????") TrayItemSetOnEvent($tray_showgui,"_gui_show") TrayItemSetOnEvent($tray_showproxyform,"_proxy_settings") GUISetOnEvent($GUI_EVENT_CLOSE,"_close_proxy_settings",$Proxy_Form ) GUISetState(@SW_SHOW,$gui) _read_ini() _mainsocket_create() While 1 $newclientsock = TCPAccept($proxysocket) If $newclientsock <> -1 Then _save("] new HTTP clientconnection :" &_SocketToIP($newclientsock) &@CRLF) _clientconnection_to_mainarray($newclientsock,80,"HTTP") EndIf $newclientsockssl = TCPAccept($proxysocketssl) If $newclientsockssl <> -1 Then _save("] new HTTPS clientconnection :" &_SocketToIP($newclientsockssl) &@CRLF) _clientconnection_to_mainarray($newclientsockssl,443,"HTTPS","start") EndIf ;--Recieving Req from Client For $i = 1 To UBound($mainarray) -1 If $mainarray[$i][1] <> "" Then $request = TCPRecv($mainarray[$i][1],100000) If @error Then _save("] Client " & $i & " closed connection after " & Floor(TimerDiff($mainarray[$i][5])) & " ms" & @CRLF) _mainarray_deleteclient($i) EndIf If $request <> "" Then _save("] Client " & $i & " requested" & @CRLF & @CRLF & $request & @CRLF) $mainarray[$i][9] += 1 $mainarray[$i][3] = $request If GUICtrlRead($checkbox_debug_content) = 1 Then _save($request & @CRLF) EndIf EndIf Next ;--connecting and sending Req to Host For $i = 1 To UBound($mainarray) -1 If $mainarray[$i][3] <> "" Then If $mainarray[$i][2] = "" Then IF $FUseProxy Then ; $forward = _Get_Address($mainarray[$i][3]) $forward = $mainarray[$i][3] ;????? ????? ???????? ?????? ?? ?????? _save("]" & $i &" ?????????? ?????? ?? ?????? : " & $forward & @CRLF) ; Else ; $forward = _Get_Address($mainarray[$i][3]) ;????? ????? ???????? ?????? ?? ?????? _save("]" & $i &" Got Host Address : " & $forward & @CRLF) ; EndIf $mainarray[$i][6] = 0 $mainarray[$i][4] = $forward If $forward = "0" Then _Send_Response($mainarray[$i][1],400) _save("]" & $i &" Host is 0 , Error 400" & @CRLF) Else IF $FUseProxy Then ; $serverip = GUICtrlRead($PF_IP) $mainarray[$i][0]=GUICtrlRead($PF_Port) ; Else ; $serverip = TCPNameToIP($forward) ; ENDIF $serversock = TCPConnect($serverip,$mainarray[$i][0]) If $serversock <> -1 Then _save("]" & $i &" Connected to Host: " & $forward & @CRLF) $mainarray[$i][2] = $serversock Else _save("]" & $i &" Not Connected to Host: " & $forward & @CRLF) _Send_Response($mainarray[$i][1],400) _mainarray_deleteclient($i) EndIf EndIf Else $forward = _Get_Address($mainarray[$i][3]) If $forward <> $mainarray[$i][4] Then _save("]" & $i &" Host Address changed from: " & $mainarray[$i][4] & " to: " & $forward & @CRLF) $mainarray[$i][4] = $forward TCPCloseSocket($mainarray[$i][2]) $mainarray[$i][2] = "" EndIf EndIf If $mainarray[$i][2] <> "" Then $prevlen = StringLen($mainarray[$i][3]) $mainarray[$i][3] = _request_modify($mainarray[$i][3],$mainarray[$i][4]) If $mainarray[$i][7] = "" Then ;$mainarray[$i][3] = _request_modify($mainarray[$i][3],$mainarray[$i][4]) TCPSend($mainarray[$i][2] , $mainarray[$i][3]) If Not @error Then _save("]" & $i &" Sending HTTP to Host " & $mainarray[$i][4] & " successfull prevlen:" & $prevlen & " now:" & StringLen($mainarray[$i][3]) & @CRLF) $mainarray[$i][3] = "" Else _save("]" & $i &" Error Sending HTTP to Host " & @CRLF) EndIf EndIf EndIf EndIf Next ;--Waiting for Response from Host and Sending to client For $i = 1 To UBound($mainarray) -1 If $mainarray[$i][2] <> "" Then $serverresponse = TCPRecv($mainarray[$i][2],400000,1) If @error Then _mainarray_hostkillclient($i) EndIf If $serverresponse <> Binary("") Then If $mainarray[$i][6] = 0 Then _save("]" & $i &" Got Host response" & @CRLF) If $mainarray[$i][1] <> "" And $mainarray[$i][7] = "" Then TCPSend($mainarray[$i][1],$serverresponse) If Not @error Then _save("]" & $i &" Sent data to Client " & @CRLF) If GUICtrlRead($checkbox_debug_content) = 1 Then _save(BinaryToString($serverresponse) & @CRLF) EndIf EndIf ElseIf $mainarray[$i][6] = 1 Then TCPSend($mainarray[$i][1],"HTTP/1.1 " & "403") _mainarray_hostkillclient($i) EndIf EndIf EndIf Next ;---only for HTTPS For $i = 1 To UBound($mainarray) -1 If $mainarray[$i][1] <> "" And $mainarray[$i][3] <> "" And $mainarray[$i][8] = "HTTPS" And $mainarray[$i][7] = "start" Then _Send_Response($mainarray[$i][1],200) ;,$data="") $mainarray[$i][3] = "" $mainarray[$i][7] = "" EndIf Next WEnd Func _proxy_settings() ; _read_ini() GUISetState(@SW_SHOW, $Proxy_Form) ; EndFunc Func _close_proxy_settings() ; GUISetState(@SW_HIDE, $Proxy_Form) ; EndFunc Func _read_ini() ; _GUICtrlEdit_SetText($PF_Port, IniRead($ini, "PROXY", "PROXYPORT", "")) _GUICtrlEdit_SetText($PF_IP, IniRead($ini, "PROXY", "PROXYIP", "")) _GUICtrlEdit_SetText($PF_Login, IniRead($ini, "PROXY", "PROXYUSER", "")) _GUICtrlEdit_SetText($PF_Pass, IniRead($ini, "PROXY", "PROXYPASS", "")) IF IniRead($ini, "PROXY", "PROXYUSE", 0) = 1 Then ; GUICtrlSetState ($PF_CheckboxUse, $GUI_CHECKED) $FUseProxy=True $SProxyAuthCode=_Base64Encode(IniRead($ini, "PROXY", "PROXYUSER", "") & ":" & IniRead($ini, "PROXY", "PROXYPASS", "")) ; $SProxyAuthCode=B64Encode(IniRead($ini, "PROXY", "PROXYUSER", "") & ":" & IniRead($ini, "PROXY", "PROXYPASS", "")) ; Else ; GUICtrlSetState ($PF_CheckboxUse, $GUI_UNCHECKED) $FUseProxy=False ; ENDIF ; EndFunc Func _save_proxy_settings() ; IniWrite($ini,"PROXY","PROXYPORT",GUICtrlRead($PF_Port)) IniWrite($ini,"PROXY","PROXYIP",GUICtrlRead($PF_IP)) IniWrite($ini,"PROXY","PROXYUSER",GUICtrlRead($PF_Login)) IniWrite($ini,"PROXY","PROXYPASS",GUICtrlRead($PF_Pass )) ; IF GUICtrlRead($PF_CheckboxUse)=$GUI_CHECKED Then ; $FUseProxy=True IniWrite($ini,"PROXY","PROXYUSE",1) $SProxyAuthCode=_Base64Encode(GUICtrlRead($PF_Login) & ":" & GUICtrlRead($PF_Pass )) _mainsocket_create() ; Else ; $FUseProxy=False IniWrite($ini,"PROXY","PROXYUSE",0) _mainsocket_create() ; ENDIF ; EndFunc Func _show_array() _ArrayDisplay($mainarray) EndFunc Func _mainsocket_save() IniWrite($ini,"SYSTEM","PROXYPORT",GUICtrlRead($input_proxyport)) IniWrite($ini,"SYSTEM","PROXYIP",GUICtrlRead($input_proxyip)) IniWrite($ini,"SYSTEM","PROXYPORTSSL",GUICtrlRead($input_proxyportssl)) _mainsocket_create() EndFunc Func _mainsocket_create() TCPShutdown() TCPStartup() $IP = IniRead($ini,"SYSTEM","PROXYIP","127.0.0.1") $PORT = IniRead($ini,"SYSTEM","PROXYPORT","8080") $PORTSSL = IniRead($ini,"SYSTEM","PROXYPORTSSL","8043") GUICtrlSetData($input_proxyip, $IP) GUICtrlSetData($input_proxyport,$PORT) GUICtrlSetData($input_proxyportssl,$PORTSSL) $proxysocket = TCPListen($IP,$PORT) If @error Then _GUICtrlEdit_AppendText($DEBUG , "] Error HTTP Proxy couldn't bind socket on IP :" & $IP & " Port :" & $PORT & @CRLF) Else _GUICtrlEdit_AppendText($DEBUG , "] HTTP Proxy listening on IP :" & $IP & " Port :" & $PORT & @CRLF) EndIf $proxysocketssl = TCPListen($IP,$PORTSSL) If @error Then _GUICtrlEdit_AppendText($DEBUG , "] Error HTTPS Proxy couldn't bind socket on IP :" & $IP & " Port :" & $PORTSSL & @CRLF) Else _GUICtrlEdit_AppendText($DEBUG , "] HTTPS Proxy listening on IP :" & $IP & " Port :" & $PORTSSL & @CRLF) EndIf EndFunc Func _Get_Address($text) If IsBinary($text) Then $text = BinaryToString($text) EndIf $serversock=StringSplit($text , @CRLF,1) For $i=1 To $serversock[0] If StringLeft($serversock[$i],6)="Host: " Then Return StringTrimLeft($serversock[$i],6) EndIf Next Return 0 EndFunc Func _clientconnection_to_mainarray($sock,$port = 80,$type = "HTTP",$state = "") For $i = 1 To UBound($mainarray) -1 If $mainarray[$i][1] = "" And $mainarray[$i][2] = "" Then $mainarray[$i][1] = $sock $mainarray[$i][0] = $port $mainarray[$i][5] = TimerInit() $mainarray[$i][7] = $state $mainarray[$i][8] = $type _save("] Added new client to mainarray , pos: " & $i & @CRLF) If $i + 5 > UBound($mainarray) Then ReDim $mainarray[UBound($mainarray)+5][10] Return EndIf Next EndFunc Func _mainarray_deleteclient($line) TCPCloseSocket($mainarray[$line][1]) $mainarray[$line][0] = "" $mainarray[$line][1] = "" $mainarray[$line][3] = "" $mainarray[$line][4] = "" $mainarray[$line][5] = "" $mainarray[$line][6] = "" $mainarray[$line][7] = "" $mainarray[$line][8] = "" $mainarray[$line][9] = "" If $mainarray[$line][2]<> "" Then TCPCloseSocket($mainarray[$line][2]) $mainarray[$line][2] = "" EndIf EndFunc Func _mainarray_hostkillclient($line) _save("]" & $line &" Connection Closed by Host after " & Floor(TimerDiff($mainarray[$line][5])) & " ms" & @CRLF) $mainarray[$line][2] = "" $mainarray[$line][4] = "" $mainarray[$line][5] = "" If $mainarray[$line][1]<> "" Then TCPCloseSocket($mainarray[$line][1]) _mainarray_deleteclient($line) EndIf EndFunc Func _Send_Response($browsersock,$code,$data="") If $data="" Then $data=@CRLF & @CRLF Else $data=@CRLF & $data & @CRLF & @CRLF EndIf TCPSend($browsersock , "HTTP/1.0 " & $code & " Message" & $data) EndFunc Func _quit() TCPShutdown() Exit EndFunc Func _gui_show() If $GUISHOW = 0 Then Local $pw = InputBox("Enter Password","Enter Password","","*",150,130) If Not @error Then If $pw = "1234" Then GUISetState(@SW_SHOW) $GUISHOW = 1 Return EndIf EndIf ElseIf $GUISHOW = 1 Then GUISetState(@SW_HIDE) $GUISHOW = 0 Return EndIf EndFunc Func _save($text) If GUICtrlRead($checkbox_debug_save) = 1 Then $file = FileOpen(@ScriptDir & "\log\" & @Year & @MON & @MDAY & "-log.txt",9) FileWrite ($file,$text) FileClose($file) Endif If GUICtrlRead($checkbox_debug) = 1 Then _GUICtrlEdit_AppendText($DEBUG , $text) Endfunc Func _SocketToIP($SHOCKET) Local $sockaddr, $aRet $sockaddr = DllStructCreate("short;ushort;uint;char[8]") $aRet = DllCall("Ws2_32.dll", "int", "getpeername", "int", $SHOCKET, _ "ptr", DllStructGetPtr($sockaddr), "int*", DllStructGetSize($sockaddr)) If Not @error And $aRet[0] = 0 Then $aRet = DllCall("Ws2_32.dll", "str", "inet_ntoa", "int", DllStructGetData($sockaddr, 3)) If Not @error Then $aRet = $aRet[0] Else $aRet = 0 EndIf $sockaddr = 0 Return $aRet EndFunc ;==>SocketToIP Func _debug_binary() Local $aSel = _GUICtrlEdit_GetSel($DEBUG) Local $text = StringMid(GUICtrlRead($DEBUG),$aSel[0]+1,$aSel[1]-$aSel[0]) If $text <> "" Then Else $text = InputBox("Binary to String","Enter Binary Data") EndIf If StringLower(StringLeft($text,2)) <> "0x" Then $text = "0x" & $text $tempfile = FileOpen(@ScriptDir & "\temp.txt",2) FileWrite($tempfile,BinaryToString($text)) FileClose($tempfile) ShellExecute(@ScriptDir & "\temp.txt") EndFunc Func _debug_clear() GUICtrlSetData($DEBUG,"") EndFunc Func _request_modify($req,$host) Local $encoding = "Accept-Encoding: identity" ;deflate, gzip, compress, Local $reqsplit Local $modified_method = 0 , $modified_connection = 0 , $modified_encoding = 0 ; If $req <> "" And Not IsBinary($req) Then $reqsplit = StringSplit($req,@CRLF,1) If IsArray($reqsplit) Then For $i = 1 to $reqsplit[0] - 1 _save("] modifying :" & $i & " " & $reqsplit[$i]) IF Not $FUseProxy Then ; ???? ???????? ??? ?????? If StringLeft($reqsplit[$i],3) = "GET" Or StringLeft($reqsplit[$i],4) = "POST" Or StringLeft($reqsplit[$i],7) = "CONNECT" And $modified_method = 0 Then $reqsplit[$i] = StringReplace($reqsplit[$i],$host,"") $reqsplit[$i] = StringReplace($reqsplit[$i],"http://","") $reqsplit[$i] = StringReplace($reqsplit[$i],":443","") $modified_method = 1 EndIf If StringInStr(Stringlower($reqsplit[$i]),"proxy-connection: keep-alive") And $modified_connection = 0 Then $reqsplit[$i] = "Connection: keep-alive" $modified_connection = 1 EndIf If StringInStr(Stringlower($reqsplit[$i]),"accept-encoding") And $modified_encoding = 0 Then $reqsplit[$i] = $encoding $modified_encoding = 1 EndIf EndIf _save(" -> to :" & $reqsplit[$i] & @CRLF) Next $req = _ArrayToString($reqsplit, @CRLF , 1 , Ubound($reqsplit)-1) IF $FUseProxy Then $req=StringReplace($req, @CRLF & @CRLF, @CRLF & "Proxy-Authorization: Basic " & $SProxyAuthCode & @CRLF & @CRLF,-1) ; ???? ???????? ????? ?????? ????????? ??????????? EndIf If GUICtrlRead($checkbox_debug_content) = 1 Then _save("] Request modified to:" & @CRLF) _save($req &@CRLF) EndIf EndIf Return $req EndFunc
- 34 replies
-
- url filter
- blacklist
-
(and 3 more)
Tagged with:
-
The Wrong of _GUICtrlComboBoxEx_Create
stalliont replied to cnmini's topic in AutoIt General Help and Support
Use this: $mypiclist = _FileListToArray(@ScriptDir & "\ImagesPics\") For $x = 1 to $mypiclist[0] _GUIImageList_AddBitmap($hImage, @ScriptDir & "\ImagesPics\" & $mypiclist[$x]) Next -
Hello just want to know is the XSkinTabs() function supported? Or is it still coming soon? I am still waiting for that feature, because I have only a program which mainly consist of GuiCtrlCreateTab, and buttons. Thanks heaps
-
I know how to use he's code. Here is how it works, the place where it have all the If $row[$xwidth] = 4 etc It actually counts pixels vertically Example the letter "L" might have 9 pixels for the first column, where it has $row[$xwidth+1] = 1 is the next column. So lettle "L" will have $row[$xwidth]= 9 And $row[$xwidth+1] = 1 And $row[$xwidth+2] = 1 And $row[$xwidth+3] = 1 the problem with this is with letters that have the same amount of pixels counts such as letter "b", "p", "d", "q", "i", "1", "l", "j", "n", "r", "m", "v", "w" all the above letters have problems recognising a unique pixel count. I would recomment if you could change the code to read pixel counts in the horizontal position not vetically.
-
How to update Input with coma(,) separator?
stalliont replied to stalliont's topic in AutoIt GUI Help and Support
Nope I tried looking at StringFormat, Its used for numbers and can put decimals, but I couldn't make it to put comas after a user type in certain numbers to represent each 3 digits for thousands. EG user input 9999 = 9,999. User input 99999 = 99,999. user input 999999 = 999,999 user input 9999999 = 9,999,999 etc And when I use GuiCtrlRead($input) I get 9,999 with comas, soI used StringSplit and add them together to get 9999 back. But gets stuck somewhere. And also tried StringInsert didn't work too well. I wonder if there is an easier way. -
Hello all I tried to search but couldn't find a solution. What I want is when the user enters numbers with 3 digits is to enter a coma(",") to separate each 1000. For example if I enter 1000 into the input box, it will update it to 1,000 or better $1,000 Another example is when I enter 900500 I want it to show $900,500 etc Please help how could I do it? #include <GUIConstants.au3> $GUI_Price = GUICreate("Enter Price", 191, 85, -1, -1, $WS_POPUP+$WS_CAPTION) $Input_Price = GUICtrlCreateInput("", 0, 0, 180, 20) ;GUICtrlSetLimit(-1,10) $Button_1 = GUICtrlCreateButton("Save", 20, 40, 60, 20) $Button_2 = GUICtrlCreateButton("Cancel", 100, 40, 60, 20) $set = 0 GUISetState() Do $msg = GUIGetMsg() If GuiCtrlRead($Input_Price) >= 999 and $set <> 1 Then GuiCtrlSetData($Input_Price, GuiCtrlRead($Input_Price) & ",") $set = 1 ElseIf GuiCtrlRead($Input_Price) < 999 and $set = 1 Then $set = 0 EndIf If GuiCtrlRead($Input_Price) = "999,999" Then GuiCtrlSetData($Input_Price, GuiCtrlRead($Input_Price) & ",") $set = 1 EndIf If $msg = $Button_2 Then Exit EndIf Until $msg = $GUI_EVENT_CLOSE As you can see I tried using If, Else statement but didn't work as I wanted.
-
Perform action when any text is entered into a GUI
stalliont replied to sjorrel's topic in AutoIt General Help and Support
Use this HotKeySet("{ENTER}", "Enter") Func Enter() $msg = $EnterButton EndFunc -
the server wouldn't let me enter public IP address. Yes running on the LAN works fine. I'm using the lastest Autoit beta, so I don't get any Include, or *.h file not find error. And I have check my firewall settings to port forward to my internal Address(where server.au3 is run). But the program when u start the server.au3 doesn't allow to enter 203.X.X.X etc. For example I enter 203.23.167.55 then click "Listen". And get the "An unexpected error occurred (Error 10049)" To replicate this problem, after entering a public IP address, Click "Listen", then click "Pause", Then click "Listen" again. You get the ERROR MSG. I assume there is some program coding error. Such as GuiCtrlRead($TxtAddress) not reading properly somewhere in the script. And I can't find where is it, to modify to fix this.
-
Has anyone tried to connect through the internet? Using an Internet public IP address? I always get this error "An unexpected error occurred (Error 10049)" When entering a public IP address, such as, 203.X.X.X or 59.X.X.X etc. I can't seem to get it to accept an internet IP. Connecting locally on the same LAN works fine. using 127.0.0.1, 192.X.X.X, or 10.X.X.X