Configuring an HTTP Client to Use a Proxy
To setup a proxy directive, set the #proxyUrl on the transport configuration registered as 'httpl'.
(SstTransport configurationRegistry at: 'httpl')proxyUrl: ('http://mproxy.com:8080') sstAsUrl.
httpl is an internal designation for a transport scheme which is expected to be a client. It uses the SstTcpLightTransport which doesn't have the ability to listen and accept connections.
See the SstHttpClientExample after you have loaded the Server Smalltalk SST-Http feature to see in more detail how proxies work in the Sst Http framework
Client Tunneling
HTTPS client tunneling through an HTTP proxy
The SST HTTP client support for HTTP proxies provides for tunneling HTTPS through an HTTP proxy.
The central class is a connection class SstHttpsTunnelConnection which knows how to do the upgrade from TCP to SSL.
For an HTTPS client to tunnel through an HTTP proxy, it must use a transport configuration that specifies a #socketClass of SciSocket and a #connectionClass of SstHttpTunneledConnection. The following method has been added as a convenience for defining a transport configuration to support this scenario:
SstHttpClient class>>#initializeTransportScheme:forHttpsTunnelThrough:proxyAuth:
Example:
SstHttpClient
initializeTransportScheme: 'local_https_tunnel'
forHttpsTunnelThrough: 'proxy.acme.com:80'
proxyAuth: nil
 
The method above accepts 'nil' as a proxyAuth credential to indicate that proxy authentication is not required.
The class SstHttpClient is introduced with this enhancement. A client using the transport configuration defined above would be created using the factory method SstHttpClient class>>#forTransportScheme:, as in the example below.
|client|
(client := SstHttpClient forTransportScheme: 'local_https_tunnel') startUp.
client get: 'https://www.foobar.com/secure/index.html']
ensure: client shutDown].
 
It is also possible to configure SST so that the convenience method SstHttpUrl>>fetch uses this tunneling feature. This is done in the same way as illustrated above for an application-specific transport configuration, specifying instead the identifer for the default https client configuration.
SstHttpClient
initializeTransportScheme: 'httpsl'
forHttpsTunnelThrough: 'proxy.acme.com:80'
proxyAuth: nil
 
Having done this, the following code is equivalent to the example above.
'https://www.foobar.com/secure/index.html' sstAsUrl fetch
Last modified date: 06/05/2019