| View previous topic :: View next topic |
| Author |
Message |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 7:03 pm Post subject: |
|
|
good news
i turn on logging (proxy server has a logging option) so i cans see what works this seems to work
| Code: |
internet http,create,1
INTERNET HTTP,PROXY,1,192.168.1.1,3128
internet http,threads,1,on
internet http,protocol,1,1
internet http,useragent,1,test
|
now i just have to make it so people can edit it to there setting  _________________ Have a nice day  |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 7:11 pm Post subject: |
|
|
hummmm i know how i can make it so people can edit it BUT not sure how to make it so that they can turn that on or off....
hard to explain..i hope ya follow what i mean _________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 7:36 pm Post subject: |
|
|
Try this method...
| Code: | EXTERNAL @PATH(%0)vdsipp.dll
DIALOG CREATE,Proxy Support,-1,0,430,219
DIALOG ADD,CHECK,CHECK1,14,16,200,18,Enable access through a proxy server,,,CLICK
DIALOG ADD,BUTTON,OK,182,240,64,24,OK
DIALOG ADD,BUTTON,Cancel,182,310,64,24,Cancel
DIALOG ADD,GROUP,GROUP1,46,16,398,124,Proxy Settings
DIALOG ADD,TEXT,TEXT1,72,28,,,Proxy Address:
DIALOG ADD,EDIT,EDIT1,68,104,180,19
DIALOG ADD,TEXT,TEXT2,96,28,,,Proxy Port:
DIALOG ADD,EDIT,EDIT2,92,104,56,19
DIALOG ADD,TEXT,TEXT3,120,28,,,Username:
DIALOG ADD,EDIT,EDIT3,115,104,180,19
DIALOG ADD,TEXT,TEXT4,144,28,,,Password:
DIALOG ADD,EDIT,EDIT4,139,104,,,
DIALOG ADD,RADIO,RADIO1,74,308,90,72,Proxy Version,Socks 4|Socks 4A|Socks 5,Socks 4
DIALOG SHOW
DIALOG DISABLE,GROUP1
INTERNET HTTP,CREATE,1
:eventloop
WAIT EVENT
%%event = @EVENT()
GOTO %%event
:CancelBUTTON
:close
INTERNET HTTP,DESTROY,1
EXIT
:CHECK1CLICK
IF @DLGTEXT(CHECK1)
DIALOG ENABLE,GROUP1
ELSE
DIALOG DISABLE,GROUP1
END
GOTO eventloop
:OKBUTTON
IF @DLGTEXT(CHECK1)
%%proxy_ip = @DLGTEXT(EDIT1)
%%proxy_port = @DLGTEXT(EDIT2)
%%proxy_user = @DLGTEXT(EDIT3)
%%proxy_pass = @DLGTEXT(EDIT4)
%%proxy_ver = @DLGTEXT(RADIO1)
IF @EQUAL(%%proxy_ver,Socks 4)
%%proxy_ver = 0
END
IF @EQUAL(%%proxy_ver,Socks 4A)
%%proxy_ver = 1
END
IF @EQUAL(%%proxy_ver,Socks 5)
%%proxy_ver = 2
END
IF @BOTH(%%proxy_ip,%%proxy_port)
INTERNET HTTP,PROXY,1,%%proxy_ip,%%proxy_port,%%proxy_user,%%proxy_pass,%%proxy_ver
ELSE
WARN "You must specify at least the address and port of the proxy server you will be using!"
GOTO eventloop
END
END
INTERNET HTTP,THREADS,1,ON
INTERNET HTTP,PROTOCOL,1,1
INTERNET HTTP,USERAGENT,1,Test
GOTO eventloop |
Check boxes are a great way to enable or disable a feature in your programs. _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 7:39 pm Post subject: |
|
|
thanks i will play with that i'am playing with ini so it can save the setting so the user won't have to enter it in all the time  _________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 7:44 pm Post subject: |
|
|
Right on... good luck and have fun!  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 8:23 pm Post subject: |
|
|
i got most of it working but i have question i have it read a ini file so it saves the setting BUT how do i make it check a box if the ini file has the proxy server on?
thanks
like below if ini file has it turn on how can i make it check this box? then if a user unchecks it it will write to the ini file...
thanks
| Code: |
DIALOG ADD,CHECK,CHECK1,14,16,200,18,Enable access through a proxy server,,,CLICK
|
_________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 8:33 pm Post subject: |
|
|
Just read from the INI file before you create the dialog. Something like this...
| Code: | EXTERNAL @PATH(%0)vdsipp.dll
INIFILE OPEN,@PATH(%0)proxy.ini
%%proxy_enable = @INIREAD(SETTINGS,proxy_enable)
%%proxy_ip = @INIREAD(SETTINGS,proxy_ip)
%%proxy_port = @INIREAD(SETTINGS,proxy_port)
%%proxy_user = @INIREAD(SETTINGS,proxy_user)
%%proxy_pass = @INIREAD(SETTINGS,proxy_pass)
%%proxy_ver = @INIREAD(SETTINGS,proxy_ver)
IF @EQUAL(%%proxy_ver,0)
%%proxy_ver = "Socks 4"
END
IF @EQUAL(%%proxy_ver,1)
%%proxy_ver = "Socks 4A"
END
IF @EQUAL(%%proxy_ver,2)
%%proxy_ver = "Socks 5"
END
DIALOG CREATE,Proxy Support,-1,0,430,219
DIALOG ADD,CHECK,CHECK1,14,16,200,18,Enable access through a proxy server,%%proxy_enable,,CLICK
DIALOG ADD,BUTTON,OK,182,240,64,24,OK
DIALOG ADD,BUTTON,Cancel,182,310,64,24,Cancel
DIALOG ADD,GROUP,GROUP1,46,16,398,124,Proxy Settings
DIALOG ADD,TEXT,TEXT1,72,28,,,Proxy Address:
DIALOG ADD,EDIT,EDIT1,68,104,180,19,%%proxy_ip
DIALOG ADD,TEXT,TEXT2,96,28,,,Proxy Port:
DIALOG ADD,EDIT,EDIT2,92,104,56,19,%%proxy_port
DIALOG ADD,TEXT,TEXT3,120,28,,,Username:
DIALOG ADD,EDIT,EDIT3,115,104,180,19,%%proxy_user
DIALOG ADD,TEXT,TEXT4,144,28,,,Password:
DIALOG ADD,EDIT,EDIT4,139,104,180,19,%%proxy_pass
DIALOG ADD,RADIO,RADIO1,74,308,90,72,Proxy Version,"Socks 4|Socks 4A|Socks 5",%%proxy_ver
DIALOG SHOW
DIALOG DISABLE,GROUP1
INTERNET HTTP,CREATE,1
GOTO CHECK1CLICK
:eventloop
WAIT EVENT
%%event = @EVENT()
GOTO %%event
:CancelBUTTON
:close
INTERNET HTTP,DESTROY,1
EXIT
:CHECK1CLICK
IF @DLGTEXT(CHECK1)
DIALOG ENABLE,GROUP1
ELSE
DIALOG DISABLE,GROUP1
END
GOTO eventloop
:OKBUTTON
IF @DLGTEXT(CHECK1)
%%proxy_ip = @DLGTEXT(EDIT1)
%%proxy_port = @DLGTEXT(EDIT2)
%%proxy_user = @DLGTEXT(EDIT3)
%%proxy_pass = @DLGTEXT(EDIT4)
%%proxy_ver = @DLGTEXT(RADIO1)
IF @EQUAL(%%proxy_ver,"Socks 4")
%%proxy_ver = 0
END
IF @EQUAL(%%proxy_ver,"Socks 4A")
%%proxy_ver = 1
END
IF @EQUAL(%%proxy_ver,"Socks 5")
%%proxy_ver = 2
END
IF @BOTH(%%proxy_ip,%%proxy_port)
INTERNET HTTP,PROXY,1,%%proxy_ip,%%proxy_port,%%proxy_user,%%proxy_pass,%%proxy_ver
ELSE
WARN "You must specify at least the address and port of the proxy server you will be using!"
GOTO eventloop
END
END
INTERNET HTTP,THREADS,1,ON
INTERNET HTTP,PROTOCOL,1,1
INTERNET HTTP,USERAGENT,1,Test
GOTO eventloop |
_________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 8:44 pm Post subject: |
|
|
right i got that part BUT how to have it check the box tho? if the ini file has proxy on??
edit - i see what ya _________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 8:46 pm Post subject: |
|
|
Do you understand how I did it  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 8:52 pm Post subject: |
|
|
yes i didn't know i could do this:
| Code: |
DIALOG ADD,CHECK,CHECK1,14,16,200,18,Enable access through a proxy server,%%proxy_enable,,CLICK
|
i thought you could only do that to edit boxes...
now if it's checked cuase the ini has a value in there if i was to uncheck it the modity the code to write to ini file that would work right i mean modifty this code:
| Code: |
:CHECK1CLICK
IF @DLGTEXT(CHECK1)
DIALOG ENABLE,GROUP1
ELSE
DIALOG DISABLE,GROUP1
rem put code here to write to ini file
END
GOTO eventloop
|
_________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 9:03 pm Post subject: |
|
|
That is correct... but if you write any value to the INI file the box will be checked the next time you run it. So, you just want to delete the value for the proxy_enable key. To modify my example above...
| Code: | :CHECK1CLICK
IF @DLGTEXT(CHECK1)
DIALOG ENABLE,GROUP1
ELSE
DIALOG DISABLE,GROUP1
rem *** open the INI file and delete the value for the proxy_enable key
INIFILE OPEN,@PATH(%0)proxy.ini
INIFILE WRITE,SETTINGS,proxy_enable,
END
GOTO eventloop |
_________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
tim6389 Professional Member


Joined: 01 Aug 2002 Posts: 790
|
Posted: Wed Apr 30, 2003 9:07 pm Post subject: |
|
|
yup i found that out i had it say off...and the box would be checked so i just leave it blank now....
thanks for the help
now i have to fix it so when i close that box it don't close my whole program...hheheehe
i have a hard time fixing that problem....
thanks for the help _________________ Have a nice day  |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Apr 30, 2003 9:40 pm Post subject: |
|
|
No problem, man! Glad to help.  _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1567
|
Posted: Thu May 01, 2003 3:59 am Post subject: |
|
|
| You simply need to use the PROXY command, after using the proxy command any http request you make will use the proxy server you specified. Also no there is no way to my knowledge to find what version a proxy server uses other then to try and see if it works. You can try to fetch a page after setting the proxy and using each version of socks to see if it works. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|