Some offers:
- in proxy function not split user and password, but leave proxy-auth
"user:password" (sorry);
- add base64.lisp from clocc or its derivative;
- change clhs.lisp (need add errors processing):
$ diff -u clhs.lisp.orig clhs.lisp
--- clhs.lisp.orig Tue Nov 22 19:11:07 2005
+++ clhs.lisp Wed Nov 23 09:11:25 2005
@@ -131,12 +131,12 @@
(let* ((host-port-end (position #\/ url :start #2#))
(port-start (position #\: url :start #2# :end host-port-end))
(url-host (subseq url #2# (or port-start host-port-end)))
- (host (if *proxy* (third *proxy*) url-host))
+ (host (if *proxy* (second *proxy*) url-host))
(url-port (if port-start
(parse-integer url :start (1+ port-start)
:end host-port-end)
*http-port*))
- (port (if *proxy* (fourth *proxy*) url-port))
+ (port (if *proxy* (third *proxy*) url-port))
(path (if *proxy* url
(if host-port-end (subseq url host-port-end) "/")))
(sock (handler-bind ((error (lambda (c)
@@ -148,6 +148,9 @@
(socket:socket-connect port host :external-format :dos)))
status code content-length)
(format t "connected...") (force-output)
+ (when (and *proxy* (first *proxy*)) ;; proxy-auth
+ (format sock "Proxy-Authorization: Basic ~A~%" ;; may be not
authentic
+ (base64-encode (first *proxy*)))) ;; need vector? Is it work?
(format sock "GET ~A HTTP/1.0~%User-agent: ~A~%Host: ~A~%Accept:
*/*~%Connection: close~2%" path (lisp-implementation-type) host) ; request
(write-string (setq status (read-line sock))) (force-output)
(let* ((pos1 (position #\Space status))
Thanks!
--
WBR, Yaroslav Kavenchuk.
|