VB.net Proxy doesn't change after first HttpWebRequest

I don't think so, because if you run each HttpRequest on a NEW Thread, then it works PERFECTLY, but when it is using the same thread it is created with, then it "caches" as you speak

If you want I'l show you and screen share, it is connecting to the proxies - after that the issue arises.

Sent from my Transformer Prime TF201 using Tapatalk 2
 
If you want I'l show you and screen share, it is connecting to the proxies - after that the issue arises.

Sent from my Transformer Prime TF201 using Tapatalk 2

I know because I got his code as well, I know what I'm saying :)
 
I don't think so, because if you run each HttpRequest on a NEW Thread, then it works PERFECTLY, but when it is using the same thread it is created with, then it "caches" as you speak

I know because I got his code as well, I know what I'm saying :)

That's the deal - it's not opening those up okay even in separate threads.

After testing a few things out with frankweerasinghe it turns out that it's a fault either in the protocol libs or the proxies (my money is on the protocol).

We were getting that issue with user & pass combo - but when trying out some squidproxies on the same code, it worked out okay.

So it was working without user/pass, but with, it was not.

When working with user:password combo, i set up a sniffer to see if the requests are being made - they are being made.

I changed the address to go to my local server, via those proxies, and apache was only returning the first hit out of the 5 he had coded in.
 
I have not ever set the proxies using the PRoxy.Credentials method, instead I set the credentials within a new WebProxy & then set the request's proxy to that, E.g.
If Proxy <> Nothing AndAlso Proxy <> "0" AndAlso Proxy <> "" Then
Dim myProxy As New WebProxy(Proxy, Port)
If ProxyUser <> "0" AndAlso ProxyUser <> "" Then myProxy.Credentials = New NetworkCredential(ProxyUser, ProxyPass)
request.Proxy = myProxy
End If

Never had any caching issues when using this method, you mentioned that the issue occurs when using a username/password proxy. Also when you are catching the exceptions change them to a MessageBox incase the exception is empty / not formatted for the exception you are catching so that you can see if an error occurs rather than looking over an empty listview item as if the error is occuring before you are setting the content then the content would remain the same & look like it is caching when in actual fact it has not changed at all but instead an exception occured before you get to that point.
 
I could take a look if you want. If you have not solved it by now.

The cacheing issue can come from Squid Proxy usage. When settng credentials like you do webrequest is stupid and does not pass along the credentials to every request. to bypass that issue you have to be more createive. Also if you were to use that code with many threads in the future you might suffer a underlying connection issue since you do not clean up your Connections.

Regards,
HatIsBlack
 
Could be a lot of problems here. For one, this is running on a separate thread with obvious crossthreading violations. I would load my listview into a list or an array and cycle through that to avoid marshalling (it's unnecessary in this case). Another thing, there is what has to be a global cookie container being added to the request after proxies and credentials are loaded. Now, there shouldn't be any cookies with proxy information, but if the issue is what is getting cached from the site as mentioned above (though that doesn't make much sense to me), then what is being loaded into the cookie container could be the problem. I would address issues like these before placing blame on the protocol. My two cents anyway.
 
Back
Top