by [Reinhard Max] There is not much error checking yet, but it already works for me. jlbjhgyipu while {[gets $irc line] > -1 && $line != ""} { puts $line } if {[eof $irc]} { close $irc close $sock return } } else { set socket [socket $::ircserver $::ircport] } fconfigure $sock -blocking no -buffering line fconfigure $irc -blocking no -buffering line fileevent $sock readable [list proxy $sock $irc ] fileevent $irc readable [list proxy $irc $sock] } proc proxy {sock1 sock2} { if {[gets $sock1 line] > 0} { puts $sock2 $line } if {[eof $sock1]} { puts "closing $sock1 $sock2" close $sock1 close $sock2 } return } proc main {} { set server [socket -server server $::localport] vwait ::forever } main ---- [[ [Category Internet] | [tunnel] ]]