TodayPlus Boards v2

Programming and MOD Forums => Developer's Corner Discussion => Topic started by: uk_skinner on April 08, 2005, 11:19:18 AM

Title: Update Behind proxy server
Post by: uk_skinner on April 08, 2005, 11:19:18 AM
This is old topic and I would like to start to look for a possible solution to it.

Since the radar.exe can download the city.txt (I think rss.txt too), so if we can make it works behind the proxy server then the problem should be ressolved.  However, I do not use proxy server and have the limited (even zero) knowledge about it.  I will need your help.  

From what I reading so far, in the regsitry key, there are default proxy setting in there.  If you can help me to find them out, then I can program radar.exe to retrive the information and use to make connections.  In addition, I also be able to have a helper (set-up) exe to allow user to set up the parameters and store in the registry key or a text file.

Here is my screenshot of HKEY_CURRENT_USER\software\Microsoft\Windows\CurrentVersion\Internet Settings.

Please share yours with me, but do remember to block out the confidential information, such as users name and password.  Thanks.
Title: Update Behind proxy server
Post by: Timmy on April 09, 2005, 03:08:19 AM
Uk_skinner,

As I don't almost know nothing from technical subjects, I can't help you very much. I even don't know if it helps you to give you my own screenshot of the mentioned directory....

BUT: "Better one screenshot too much, than one screenshot too too little..."

Timmy
Title: Update Behind proxy server
Post by: DeftOne on January 25, 2006, 01:57:11 PM
Any solution to this problem yet as it pertains to radar.exe?  I recently switched jobs, and am now behind a proxy server.  I managed to get TP to update weather, RSS, etc., but I am unable to get radar.exe to download.  So...anyone able to get radar.exe to work behind a proxy yet?

FYI: I got TP to update (weather, RSS, etc.) by inputing my company's proxy server information into my PPC internet connection.

On your PPC:
I managed to get my company's proxy server information without the help of any IT personel by looking in Internet Explorer's LAN settings located at:  

On your desktop machine:
Hopefully this information will be useful to someone.  Now, if I could just get radar.exe to download properly...
Title: Update Behind proxy server
Post by: uk_skinner on January 25, 2006, 03:27:53 PM
Quote from: DeftOneAny solution to this problem yet as it pertains to radar.exe?  I recently switched jobs, and am now behind a proxy server.  I managed to get TP to update weather, RSS, etc., but I am unable to get radar.exe to download.  So...anyone able to get radar.exe to work behind a proxy yet?

FYI: I got TP to update (weather, RSS, etc.) by inputing my company's proxy server information into my PPC internet connection.

On your PPC:
  • Go to:  Settings | Connections Tab | Connections | Add Proxy Server
  • Check "This network uses a proxy server to connect to the Internet"
  • Click on "Advanced" button
  • Enter proxy server information into input boxes
  • Enter Socks 5 username/password if your proxy utilizies that protocol (I used the same username/password as my desktop machine login)
I managed to get my company's proxy server information without the help of any IT personel by looking in Internet Explorer's LAN settings located at:  

On your desktop machine:
  • Internet Explorer - Go to:  Tools | Internet Options... | Connections Tab | LAN Settings Button | Advanced... Button
Hopefully this information will be useful to someone.  Now, if I could just get radar.exe to download properly...

I have to read my own post to figure out what I was thinking at that time. :oops:
Good news are that I have been used c# to make program and got better idea than I was beofre.  Recently, I even created a weather plug-in for Taiwan.  Bad news are I am very busy and have no idea when I will give a try to see I can make radar.exe work behind proxy server.  Anyway, if I dod find some time I will dig the radar.exe code and add some codes to see it will work for you.   :wink:
Title: Update Behind proxy server
Post by: DeftOne on January 25, 2006, 06:17:50 PM
Anything you can do to help would be greatly appreciated, uk_skinner.  I've really become accustomed to having local radar and traffic cam images on my PPC, and have been spoiled with your excellent app.  For the time being I will have to just sync at home and not have up-to-the-minute images.  

Looking forward to your efforts.

Thanks!
Title: Update Behind proxy server
Post by: uk_skinner on January 25, 2006, 07:59:06 PM
Quote from: DeftOneAnything you can do to help would be greatly appreciated, uk_skinner.  I've really become accustomed to having local radar and traffic cam images on my PPC, and have been spoiled with your excellent app.  For the time being I will have to just sync at home and not have up-to-the-minute images.  

Looking forward to your efforts.

Thanks!

Ok. try this.  I just added 3 code lines to read the nondynamic proxy settings in PIE but will not pick up any dynamic settings that are generated from script run by PIE, from automatic configuration entries, or from DHCP or DNS lookups.

Good luck.
Title: Update Behind proxy server
Post by: DeftOne on January 26, 2006, 08:52:03 AM
Still no luck.  I am glad to see that you're trying to help, though.  Thanks!  Hopefully we can overcome this problem eventually.
Title: Update Behind proxy server
Post by: uk_skinner on January 26, 2006, 10:52:09 AM
Quote from: DeftOneStill no luck.  I am glad to see that you're trying to help, though.  Thanks!  Hopefully we can overcome this problem eventually.

In that case, can you tell me what you need to set to acess through the proxy?  Please just give me the format not actual contents.  For example, the IP?Username?Password? I can try to let radar.exe to read a text based file to set the proxy parameters.
Title: Update Behind proxy server
Post by: DeftOne on January 26, 2006, 01:49:03 PM
My initial post in this thread kind of outlines what I needed to input, but I'll include some screenshots to clarify.

(http://i4.photobucket.com/albums/y104/DeftOneRadio/display_1.jpg)

(http://i4.photobucket.com/albums/y104/DeftOneRadio/display_2.jpg)

(http://i4.photobucket.com/albums/y104/DeftOneRadio/display_3.jpg)


Thanks again!

<EDIT> The proxy server address is in the form of proxy.companyname.com , and is the same for all the fields (HTTP, WAP, Secure WAP, and Socks) if that helps any.
Title: Update Behind proxy server
Post by: uk_skinner on January 26, 2006, 10:12:00 PM
Quote from: DeftOneMy initial post in this thread kind of outlines what I needed to input, but I'll include some screenshots to clarify.

Thanks again!

<EDIT> The proxy server address is in the form of proxy.companyname.com , and is the same for all the fields (HTTP, WAP, Secure WAP, and Socks) if that helps any.

Please try this.  First, open the proxy.txt and put the server address at the first line and port number at second line.  Please keep "http://". Put the proxy.txt and radar.exe at the same folder.  Since I am not behind the proxy server and no way to test it.  Good luck again.
Title: Update Behind proxy server
Post by: DeftOne on January 27, 2006, 09:07:14 AM
Still no luck.

I think you need to somehow incorporate the Socks 5 User ID and Password information, as I am unable to get even the weather data and RSS to work without it.  

We're getting closer, I can feel it!!!  Thanks again.
Title: Update Behind proxy server
Post by: JLG on January 27, 2006, 12:17:36 PM
The real problem here may be the configuration of your proxy server.  I had to create a profile on my server and configure some filters to allow my pda to "look through" the proxy's firewall.  If you have a reasonable relationship with your IT manager, you should talk to them about how to allow your pda to bypass the firewall.
Title: Update Behind proxy server
Post by: DeftOne on January 27, 2006, 12:51:04 PM
Well, I am able to get my pda to look through the proxy firewall for Internet Explorer and TodayPlus weather/RSS by inputing my User ID and Password in the Socks 5 authentication portion of my proxy connection information.  

The only thing I have not been able to get to look through the proxy is radar.exe.  Why?...I have no idea.  You'd think that the proxy server information that I input into my connection preferences would be global and work for every app that connected to the internet, unless there's some sort of block on the port that radar.exe uses to connect to the internet.  Maybe radar.exe needs a "filter" of some sort to allow it to work, like you said.  Unfortunately I'm new to the company, and IT support is limited to company related hardware/software - of which, I seriously doubt TodayPlus and radar.exe would fall under.  :(
Title: Update Behind proxy server
Post by: uk_skinner on January 27, 2006, 04:30:34 PM
Quote from: DeftOne

The only thing I have not been able to get to look through the proxy is radar.exe.  Why?...I have no idea.  You'd think that the proxy server information that I input into my connection preferences would be global and work for every app that connected to the internet, unless there's some sort of block on the port that radar.exe uses to connect to the internet.  Maybe radar.exe needs a "filter" of some sort to allow it to work, like you said.  Unfortunately I'm new to the company, and IT support is limited to company related hardware/software - of which, I seriously doubt TodayPlus and radar.exe would fall under.  :(

In the original radar.exe codes, there is no codes to specially deal with the proxy.  I tried to let radar.exe to use the proxy setting used in PIE, that did not work.  And I tried to used to open a proxy server within the program, that did not work either.  As you pointed out, the program need to send socks information too.  I will look into it.
Title: Update Behind proxy server
Post by: Timmy on January 27, 2006, 04:37:06 PM
(http://www.cheesebuerger.de/images/more/bigs/a063.gif)

Whaw...  Uk_skinner is back in town!!!
Title: Update Behind proxy server
Post by: uk_skinner on January 28, 2006, 08:57:32 AM
Quote from: Timmy(http://www.cheesebuerger.de/images/more/bigs/a063.gif)

Whaw...  Uk_skinner is back in town!!!

I was in-and-out. :wink:  :roll:
Title: Update Behind proxy server
Post by: grayme on January 28, 2006, 02:19:53 PM
Quote from: DeftOneWell, I am able to get my pda to look through the proxy firewall for Internet Explorer and TodayPlus weather/RSS by inputing my User ID and Password in the Socks 5 authentication portion of my proxy connection information.  

The only thing I have not been able to get to look through the proxy is radar.exe.  Why?...I have no idea.  You'd think that the proxy server information that I input into my connection preferences would be global and work for every app that connected to the internet, unless there's some sort of block on the port that radar.exe uses to connect to the internet.  Maybe radar.exe needs a "filter" of some sort to allow it to work, like you said.  Unfortunately I'm new to the company, and IT support is limited to company related hardware/software - of which, I seriously doubt TodayPlus and radar.exe would fall under.  :(

I've been able to access the internet in IE but not update weather so you are one up on me! :(
Title: Update Behind proxy server
Post by: grosquick on February 17, 2006, 08:43:56 AM
Some good news I think. I also can't get weather or rss information through the current version of radar.exe with my pocketpc by activesync because of my company's proxy I think.

I've just written a bit of vb.net code to retrieve any information from internet, through activesync and through my company's proxy and it works !

Here is the code :

 Public Function RecupHTTP(ByVal URL As String) As String
       Dim Resultat As String = ""
       Dim RecupHTTPChaine As String = ""

       Dim myWebRequest As WebRequest
       Dim myProxy As New WebProxy("http://proxydnsname or ipaddress:proxyport", True)

       myProxy.Credentials = New NetworkCredential("username", "password", "domainname")
       myWebRequest = WebRequest.Create(URL)
       myWebRequest.Proxy = myProxy
       myWebRequest.Credentials = myProxy.Credentials


       Try
           Dim myWebResponse As WebResponse
           myWebResponse = myWebRequest.GetResponse()
           Dim streamResponse As Stream = myWebResponse.GetResponseStream()
           Dim streamRead As New StreamReader(streamResponse)
           Resultat = streamRead.ReadToEnd
       Catch ex As UriFormatException
           MsgBox("Erreur")
       End Try

       RecupHTTP = Resultat

   End Function

Please uk_skinner, it would be great to have a new version of Radar.exe that could use part of this code to let me use it with todayplus !
Title: Update Behind proxy server
Post by: uk_skinner on February 17, 2006, 03:29:57 PM
Quote from: grosquickSome good news I think. I also can't get weather or rss information through the current version of radar.exe with my pocketpc by activesync because of my company's proxy I think.

I've just written a bit of vb.net code to retrieve any information from internet, through activesync and through my company's proxy and it works !

Here is the code :

 Public Function RecupHTTP(ByVal URL As String) As String
       Dim Resultat As String = ""
       Dim RecupHTTPChaine As String = ""

       Dim myWebRequest As WebRequest
       Dim myProxy As New WebProxy("http://proxydnsname or ipaddress:proxyport", True)

       myProxy.Credentials = New NetworkCredential("username", "password", "domainname")
       myWebRequest = WebRequest.Create(URL)
       myWebRequest.Proxy = myProxy
       myWebRequest.Credentials = myProxy.Credentials


       Try
           Dim myWebResponse As WebResponse
           myWebResponse = myWebRequest.GetResponse()
           Dim streamResponse As Stream = myWebResponse.GetResponseStream()
           Dim streamRead As New StreamReader(streamResponse)
           Resultat = streamRead.ReadToEnd
       Catch ex As UriFormatException
           MsgBox("Erreur")
       End Try

       RecupHTTP = Resultat

   End Function

Please uk_skinner, it would be great to have a new version of Radar.exe that could use part of this code to let me use it with todayplus !

Ok, let's try this way.  I will add codes to let the radar.exe to read all your proxy setting from a text file.  
The first line is: http://proxydnsname or ipaddress:proxyport
the second line is: username, password,domainname

Give me couple of days to work on the codes.  Again, I can not test it.
Title: Update Behind proxy server
Post by: grosquick on February 18, 2006, 02:14:57 AM
Many thanks uk_skinner. I'll do the test for you !!
Title: Update Behind proxy server
Post by: uk_skinner on February 24, 2006, 08:01:12 AM
Quote from: grosquickMany thanks uk_skinner. I'll do the test for you !!

Sorry, it took so long to do it.  It has been crazy in past two weeks.

Here it is.  After unzip, there are two files, radar.exe and proxy.txt.  If you open the proxy.txt, you should know what information that you should put.  For safe, I let program generate a "myproxy.txt" after it reads the information from proxy.txt.  It should be identical, I just want make sure the program read information right.

Make sure you pt\ut them together in the same folder.  Sorry, I did not test it.  Please let me know if there is any error.
Title: Update Behind proxy server
Post by: grosquick on February 27, 2006, 03:49:34 AM
You know what ? It works very fine for me !
Thanks again uk_skinner, you're the best !
Title: Update Behind proxy server
Post by: grayme on February 27, 2006, 04:34:05 AM
I'll give it a go in due course (manic life at the mo!  :( )

I need to work out how to get the internet accessed at work (by wire) through the proxy and for this not to affect my wifi internet/activesync connection at home... :cry:
Title: Update Behind proxy server
Post by: DeftOne on February 27, 2006, 06:11:12 PM
I'll give it a try on my end as well, but I need to restore my PPC first.  I'll let you know how it goes.  Fingers crossed...
Title: Update Behind proxy server
Post by: grosquick on March 06, 2006, 09:37:04 AM
any other positive tests ?
Title: Update Behind proxy server
Post by: grayme on March 06, 2006, 01:43:55 PM
I've still not got my ipaq to access the net through my work yet; it's all too complicated!
Title: Update Behind proxy server
Post by: DeftOne on March 06, 2006, 02:05:17 PM
I've been too busy at work to give it a try yet - especially since I have to completely restore my PPC.  I will definitely post back here with my results when I finally have a chance to give it a go.  Sorry for the delay, especially since everyone here has been so good about putting out fixes in such a timely manner.  You guys are awesome!!! :D
Title: Update Behind proxy server
Post by: DeftOne on July 20, 2006, 01:48:39 PM
Hey guys...remember me?   :lol:

I finally got around to trying out your proxy version of the radar.exe, ukskinner.  (Better late than never, right?  Make that really late.) Guess what....it works beautifully!

Thanks for your hard work!!!  :D  You're awesome!
Title: Update Behind proxy server
Post by: mikerohan on September 20, 2006, 04:04:51 AM
Hi,

I came accross this thread and this version of radar.exe has solved my problem (I am behind a proxy ...)

Great Work!

Now, I also use the "other" radar.exe when I'm at home and I would like to now if it is possible somehow to merge the funcionality in a single exe.
Right now I have to know where I am before launching one exe or the other (I'm lazy I know...)

Thanks,
   Mike
Title: Update Behind proxy server
Post by: uk_skinner on September 29, 2006, 08:38:56 AM
Quote from: mikerohanHi,

I came accross this thread and this version of radar.exe has solved my problem (I am behind a proxy ...)

Great Work!

Now, I also use the "other" radar.exe when I'm at home and I would like to now if it is possible somehow to merge the funcionality in a single exe.
Right now I have to know where I am before launching one exe or the other (I'm lazy I know...)

Thanks,
   Mike

Certainly, it is possible to just have a single exe.  However, I need to find out out how to detect proxy first.  Anyone has any idea?
Title: Update Behind proxy server
Post by: DeftOne on September 29, 2006, 04:32:40 PM
Perhaps the following MSDN links could be of some use:

http://msdn.microsoft.com/msdnmag/issues/05/08/AutomaticProxyDetection/default.aspx (Note the registry entry that contains the proxy settings.)

http://msdn2.microsoft.com/en-us/library/fze2ytx2.aspx

http://msdn2.microsoft.com/en-us/library/system.net.webproxy.aspx

I'm not sure if this applies or is useful for the .Net Compact Framework, I'll leave that determination to the experts.

If none of the above information pans out, another less desirable solution would be to prompt the user to select whether they are behind a proxy or not at the launch of radar.exe, and then proceed as necessary.  Having to select whether you're behind a proxy or not each time you do an update (run radar.exe) would be quite inconvenient though, and maybe even more of a hassle.  :?