[Pharo-project] About HTTP proxies, settings and MacOS

Marcus Denker marcus.denker at inria.fr
Wed Jun 29 14:39:39 EDT 2011

On Jun 29, 2011, at 8:25 PM, Chris Cunningham wrote:

> On Wed, Jun 29, 2011 at 5:17 AM, Mariano Martinez Peck
> <marianopeck at gmail.com> wrote:
>> So...now if I save the image in a place where I have a proxy (my work) and
>> then I try to open it in another place that has no proxy (my home), it
>> doesn't work. To solve that I did:
>> startUp
>>     OSPlatform isMacOS ifTrue: [
>>         self useHTTPProxy ifTrue: [
>>              (self getHTTPProxyHost findTokens: ':') ifNotEmpty: [:p |
>>                 NetworkSystemSettings useHTTPProxy: true.
>>                  HTTPSocket useProxyServerNamed: p first port: p second
>> asInteger]]
>>         ifFalse: [HTTPSocket stopUsingProxyServer.
>>             NetworkSystemSettings useHTTPProxy: false]]
> Am I reading this right?  If I was on, say, Windows behind a proxy,
> this would disable proxy use on startup?  So, every time I started an
> image, I would have to manually re-enable proxy use?

This is not good.

InternetConfiguration has a method called on image save that removes the proxy on
the mac:

	OSPlatform isMacOS
		ifTrue: [ HTTPSocket stopUsingProxyServer ]
startUp should not mess with the proxy on other systems.

> Would there be a way to detect if the proxy still exists on startUp,
> and if it doesn't, then temporarily disable the proxy instead?

It's the duty of the OS to provide proxy info, and the duty of the VM to provide
this to the Image. Till today, this exists only on the Mac.


Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.

More information about the Pharo-dev mailing list