=== Top of the Swiki === Attachments ===

Behind a Firewall



How to get Updates if you are Behind a Firewall:

If you are behind a firewall and can only get to the outside by using a Proxy Server. We have code in the system for that.

Find out the name of your proxy server (name or number is ok), and the port it uses. Put those into this statement, execute it once, and save your image.


HTTPSocket useProxyServerNamed: 'name of proxy server' port: 8080.

Anytime you want to, you may ask for updates. Or use any other http service in Squeak.

If you ever want to stop using the proxy server, just execute this.


HTTPSocket stopUsingProxyServer.



Question: How does one operate behind a Microsoft Proxy firewall? For some reason, DNS queries do not resolve for me (The proxy is currently set up as the primary DNS).

Mind you, this doesn't seem to be a problem for netscape or IE... but most of the other straight network programs (including telnet and ftp) just can't break through.



Question: How does one operate behind a proxy that requires you to login before connecting to the internet ?

I recently found some german (sorry lost the name of the author) code that go gets the name of documents that are pointed to by hyperlinks in the edit page box. This code launches some request to the internet, via my proxy. My proxy returns a 407 Proxy-Authentication needed. The PWS does not handle this. How to solve ?


HTTPSocket clearProxyUserPassword.
HTTPSocket useProxyServerNamed: 'my.proxy.server' port: 80.
HTTPSocket proxyUser: 'myUserID' password: 'myPassword'.

just try to do the above.

If you got an other solution, or any kind of help, please send me an email.





The solution to Frederik's problem is to modify the header of the HTTP request to include the BASE64 encoded password and user id.

I've used this file in with a Netscape Proxy Server, which requires a password. It works with Squeak 2.2 and 2.3.

Before following the directions below, you may want to 'browse code' from the file list on this change set, to make sure the revisions are consistent with the Squeak version you are using. The network methods do experience changes.

To use, file in the link above, then go to the method

proxyUserTestingComment

(Which you can find in Network-Protocols/HTTPSocket class/examples)

Revise the comment in this method to specify your proxy server name, user id, and password. Select and do it and save your image. If you move back and forth from behind a firewall, you will have to remember to clear and restore the user id/password when you do.

This is not a secure mechanism; your user id and password are stored in inside your image. Usual disclaimers apply.

...Tom M




If you are connected to the internet via a Proxy Server behind a firewall, and if your browser accesses the Proxy Server via an Automatic Proxy Configuration file (see the proxy preferences on Netscape 4.x for example):

It is normally possible to obtain the proxy server and port number information from this file by examining the contents of the file directly, since it should be a text file (probably a .pac javascript file). You won't be able to open the file directly from your browser, so you may need to try downloading it from the parent directory.

If that fails, you can examine the file via Squeak by executing:

(HTTPSocket httpGet: 'http://something/something.pac') contents withSqueakLineEndings


Once you have the name of the proxy server (and the port number), use the command described by Ted Kaehler above to connect Squeak to the outside world.