VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.
Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig
by Hal » Tue Jan 06, 2009 5:36 am
I can successfully access a web service, but now I need to access the web service through a password protected proxy. What/Where are the magic words I need to know?
-
Hal
-
- Posts: 18
- Joined: Wed Jun 06, 2007 7:30 am
by tc » Tue Jan 06, 2009 11:01 am
Here is a start, configure SST to use the tunneling feature:
- Code: Select all
SstHttpClient
initializeTransportScheme: 'httpsl'
forHttpsTunnelThrough: 'proxy.acme.com:80'
proxyAuth: nil
. . . then do a fetch:
- Code: Select all
'https://www.foobar.com/secure/index.html' sstAsUrl fetch
A proxy authorization of nil means no password is required.
--tc
-
tc
- Moderator
-
- Posts: 304
- Joined: Tue Oct 17, 2006 7:40 am
- Location: Raleigh, NC
by benvandijk » Wed Jan 07, 2009 8:23 am
When you use a password protected proxy you need to pass credentials to your proxy.
Which credentials depend on the configuration of the proxy server.
We use basic credentials.
For Https you build a tunnel:
- Code: Select all
SstHttpClient
initializeTransportScheme: 'httpsl'
forHttpsTunnelThrough: 'my.proxy.server'
proxyAuth: ('Basic ' , (AbtBase64Coder current encode: 'network\userid:password')).
For Http you do:
- Code: Select all
(SstTransport configurationRegistry at: 'httpl')
proxyUrl: ('http://my.proxy.server') sstAsUrl;
proxyCredentials: ('Basic ' , (AbtBase64Coder current encode: 'network\userid:password'));
proxyExceptionList: #().
-
benvandijk
-
- Posts: 45
- Joined: Sun Feb 25, 2007 7:14 am
- Location: Arnhem, Netherlands
by Hal » Thu Jan 08, 2009 7:06 am
Does the solution you suggest force all http traffic to go through that proxy?
I only want to route certain web service calls through a special proxy (not all).
-
Hal
-
- Posts: 18
- Joined: Wed Jun 06, 2007 7:30 am
by tc » Thu Jan 08, 2009 12:17 pm
Hello,
Yes, it configures the http transport. To use your own scheme, use a different name:
- Code: Select all
SstHttpClient
initializeTransportScheme: 'local_https_tunnel'
forHttpsTunnelThrough: 'proxy.acme.com:80'
proxyAuth: nil
. . . and to use the local scheme, do:
- Code: Select all
|client|
(client := SstHttpClient forTransportScheme: 'local_https_tunnel') startUp.
[client get: 'https://www.foobar.com/secure/index.html']
ensure: [client shutDown]
--tc
-
tc
- Moderator
-
- Posts: 304
- Joined: Tue Oct 17, 2006 7:40 am
- Location: Raleigh, NC
Return to VA Smalltalk 7.0, 7.5 & 8.0
Who is online
Users browsing this forum: Yahoo [Bot] and 1 guest