Proxy authentication

whistller

Newbie
Joined
Oct 7, 2011
Messages
1
Reaction score
0
Hi,

I have created web browser that surf to the internet through proxy and now I need to create a browser that surf to internet via proxy authentication server (server required enter username and password) and I dont know what command to write..
Maybe something has a small example ?

Pls, help
 
:D I m using a Mitshibushi controller which is having USB feature and its belong to communication class. Actually we are developing this device so we have to configure the class in the software in the device side. We are using the driver provided by thesycon for this device :yumyum:
 
First, this is the code for using a proxy with the webbrowser control:

Then you need to execute your webbrowser like this
Code:
WebBrowser1.Navigate  URL:= "http://www.google.com" _       ,Headers:= "Authorization: Basic XXXXXX" & chr$(13) & chr$(10)
Replace XXXXXX with a base64 encoded Username:Password. Here's a base64 encoding function:
Code:
Public Function Base64Enc(s$) As String
Static Enc() As Byte, Done as Boolean
Dim b() As Byte, Out() As Byte, i&, j&, L&
Const E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu  vwxyz0123456789+/"
If Not Done Then Done = True: Enc = StrConv(E, vbFromUnicode)
 
L = Len(s): b = StrConv(s, vbFromUnicode)
ReDim Preserve b(0 To (UBound(b) \ 3) * 3 + 2)
ReDim Preserve Out(0 To (UBound(b) \ 3) * 4 + 3)
For i = 0 To UBound(b) - 1 Step 3
Out(j) = Enc(b(i) \ 4): j = j + 1
Out(j) = Enc((b(i + 1) \ 16) Or (b(i) And 3) * 16): j = j + 1
Out(j) = Enc((b(i + 2) \ 64) Or (b(i + 1) And 15) * 4): j = j + 1
Out(j) = Enc(b(i + 2) And 63): j = j + 1
Next i
For i = 1 To i - L: Out(UBound(Out) - i + 1) = 61: Next i
Base64Enc = StrConv(Out, vbUnicode)
End Function

Cheers,
captchaman
 
Back
Top