PWS, (s)Wiki & Proxies

Vandendriessche, Frederik frederik.vandendriessche at
Thu Jan 28 09:29:06 UTC 1999

Question: How does one operate behind a proxy that requires you to login
before connecting to the internet ?
(Using a proxy that does not require a loginID/password is no problem) 

I recently found some german (sorry lost the name of the author) code that
gets the name of documents that are pointed to 
by hyperlinks in the edit box on a swikipage. This code launches some
request to the internet, via my proxy. 

titleForUrl: link
	| doc content start end  |
	doc := HTTPSocket httpGetDocument: link accept: nil. "accept
text/html only"                        
	(doc isKindOf: String) ifTrue: [^nil]. "error"
	doc contentType asLowercase = 'text/html' ifFalse: [^nil].
	content := doc content.
	start := content findString: '<title>' startingAt: 1 caseSensitive:
	start = 0 ifTrue: [^nil].
	end := content findString: '</title>' startingAt: start + 7
caseSensitive: false.
	end = 0 ifTrue: [^nil].
	^content copyFrom: start + 7 to: end - 1.

The first line of code causes my proxy to return a '407 Proxy-Authentication
needed' message. 
How to solve ?  

** Maybe we (and not some socket) need to create an instance of PWS (thus a
request) instead of sending messages to the HTTPSocket.
** When this request works fine (code 200), we could do the same as in the
code above.
** When there is some error (code 407), we should return this to the user,
let him/her enter his/her credentials, and retry.
** (But is all this possible?)

Anyone with other/better ideas/solutions ?


       Frederik Vandendriessche
           System Engineer, 

> eElectronic Business Services,   
           * frederik.vandendriessche at
           *  ..32/0 2 711 37 83
           L  ..32/0 2 711 39 47

More information about the Squeak-dev mailing list