Fossil SCM
Added rudimentary proxy support to fossil chat client
Commit
307233d828ecccdded86d89973523a9ab7271c8b
Parent
134e2aeccc0acc8…
1 file changed
+12
-1
+12
-1
| --- tools/fossil_chat.tcl | ||
| +++ tools/fossil_chat.tcl | ||
| @@ -6,10 +6,14 @@ | ||
| 6 | 6 | |
| 7 | 7 | set SERVERHOST fossil-scm.hwaci.com |
| 8 | 8 | # set SERVERHOST 127.0.0.1 |
| 9 | 9 | #set SERVERHOST 64.5.53.192 |
| 10 | 10 | set SERVERPORT 8615 |
| 11 | + | |
| 12 | +# set to correct values if you have to use a proxy | |
| 13 | +set PROXYHOST {} | |
| 14 | +set PROXYPORT {} | |
| 11 | 15 | |
| 12 | 16 | # Setup the user interface |
| 13 | 17 | wm title . Fossil-Chat |
| 14 | 18 | wm iconname . [wm title .] |
| 15 | 19 | |
| @@ -77,11 +81,18 @@ | ||
| 77 | 81 | # Connect to the server |
| 78 | 82 | proc connect {} { |
| 79 | 83 | global SOCKET tcl_platform |
| 80 | 84 | catch {close $SOCKET} |
| 81 | 85 | if {[catch { |
| 82 | - set SOCKET [socket $::SERVERHOST $::SERVERPORT] | |
| 86 | + if {$::PROXYHOST ne {}} { | |
| 87 | + set SOCKET [socket $::PROXYHOST $::PROXYPORT] | |
| 88 | + puts $SOCKET "CONNECT $::SERVERHOST:$::SERVERPORT HTTP/1.1" | |
| 89 | + puts $SOCKET "Host: $::SERVERHOST:$::SERVERPORT" | |
| 90 | + puts $SOCKET "" | |
| 91 | + } else { | |
| 92 | + set SOCKET [socket $::SERVERHOST $::SERVERPORT] | |
| 93 | + } | |
| 83 | 94 | fconfigure $SOCKET -translation binary -blocking 0 |
| 84 | 95 | puts $SOCKET [list login $tcl_platform(user) fact,fuzz] |
| 85 | 96 | flush $SOCKET |
| 86 | 97 | fileevent $SOCKET readable handle_input |
| 87 | 98 | keep_alive |
| 88 | 99 |
| --- tools/fossil_chat.tcl | |
| +++ tools/fossil_chat.tcl | |
| @@ -6,10 +6,14 @@ | |
| 6 | |
| 7 | set SERVERHOST fossil-scm.hwaci.com |
| 8 | # set SERVERHOST 127.0.0.1 |
| 9 | #set SERVERHOST 64.5.53.192 |
| 10 | set SERVERPORT 8615 |
| 11 | |
| 12 | # Setup the user interface |
| 13 | wm title . Fossil-Chat |
| 14 | wm iconname . [wm title .] |
| 15 | |
| @@ -77,11 +81,18 @@ | |
| 77 | # Connect to the server |
| 78 | proc connect {} { |
| 79 | global SOCKET tcl_platform |
| 80 | catch {close $SOCKET} |
| 81 | if {[catch { |
| 82 | set SOCKET [socket $::SERVERHOST $::SERVERPORT] |
| 83 | fconfigure $SOCKET -translation binary -blocking 0 |
| 84 | puts $SOCKET [list login $tcl_platform(user) fact,fuzz] |
| 85 | flush $SOCKET |
| 86 | fileevent $SOCKET readable handle_input |
| 87 | keep_alive |
| 88 |
| --- tools/fossil_chat.tcl | |
| +++ tools/fossil_chat.tcl | |
| @@ -6,10 +6,14 @@ | |
| 6 | |
| 7 | set SERVERHOST fossil-scm.hwaci.com |
| 8 | # set SERVERHOST 127.0.0.1 |
| 9 | #set SERVERHOST 64.5.53.192 |
| 10 | set SERVERPORT 8615 |
| 11 | |
| 12 | # set to correct values if you have to use a proxy |
| 13 | set PROXYHOST {} |
| 14 | set PROXYPORT {} |
| 15 | |
| 16 | # Setup the user interface |
| 17 | wm title . Fossil-Chat |
| 18 | wm iconname . [wm title .] |
| 19 | |
| @@ -77,11 +81,18 @@ | |
| 81 | # Connect to the server |
| 82 | proc connect {} { |
| 83 | global SOCKET tcl_platform |
| 84 | catch {close $SOCKET} |
| 85 | if {[catch { |
| 86 | if {$::PROXYHOST ne {}} { |
| 87 | set SOCKET [socket $::PROXYHOST $::PROXYPORT] |
| 88 | puts $SOCKET "CONNECT $::SERVERHOST:$::SERVERPORT HTTP/1.1" |
| 89 | puts $SOCKET "Host: $::SERVERHOST:$::SERVERPORT" |
| 90 | puts $SOCKET "" |
| 91 | } else { |
| 92 | set SOCKET [socket $::SERVERHOST $::SERVERPORT] |
| 93 | } |
| 94 | fconfigure $SOCKET -translation binary -blocking 0 |
| 95 | puts $SOCKET [list login $tcl_platform(user) fact,fuzz] |
| 96 | flush $SOCKET |
| 97 | fileevent $SOCKET readable handle_input |
| 98 | keep_alive |
| 99 |