I've look a little bit deeper for the problems of REBOL/View
with proxies and firewall and was able to fix it.

Heres a short hack that patches the read-net function
so that it uses proxies. A more general fix that could be included
in the next release should now be no problem anymore.

;; This function is a replace for the not proxy-capable "read-net"
;; of th actual REBOL/View release
;; simply append it to your user.r

read-net: func [
    {Read a file from the net (web). Update progress bar. Allow abort.}
    host-name
    path
    /progress callfunc port-hand
    /local port buffer hdr-brk get-data body time data errc size wholepath
][
    if error? try [
            port: open/direct/binary/no-wait [scheme: 'tcp host: 
system/schemes/default/proxy/host port-id: 
system/schemes/default/proxy/port-id]
            wholepath: rejoin ["http://" host-name path]
    ] [return none]
    insert port rejoin [
        "GET " wholepath " HTTP/1.0" crlf
        "User-Agent: REBOL/View " system/version crlf
        "Accept: */*" crlf
        "Host: " host-name crlf
        "Connection: close" crlf
        crlf
    ]
    buffer: make binary! 4000
    hdr-brk: rejoin [crlf crlf]
    size: none
    errc: 900
    get-data: func [port] [
        if none? data: copy port [close port return 'break]
        append buffer data
        if all [not size body: find/tail buffer hdr-brk] [
            parse buffer [
                "HTTP" thru " " copy errc [to " " | to newline] (errc: 
load/all errc)
                thru "Content-length:" copy size to newline]
            if errc > 299 [close port return 'break]
            size: either size [to-integer trim size] [10000]
            remove/part buffer body
            buffer: make binary! size + 32
            append buffer head body
        ]
        if all [size progress] [callfunc size length? buffer]
    ]
    dispatch append copy any [port-hand []] [
        port :get-data
        30 [print "TIMEOUT***********" close port 'break]
    ]
    if errc < 300 [return buffer]
]

Regards
Jochen Schmidt

Reply via email to