Domain Header

By biase on Apr 24, 2005

A simple Domain Header reader using mIRC socket v1.1.

menu status,menubar {
  Http Header { 
    var %' http.head- $+ $$?"Domain address to read header. $+ $crlf $+ (note: without 'http://' )"
    %' = %' $!
    if ($sock($gettok(%',1,32))) { echo 3 -s $! $+ : Socket already in use. | return }
    sockopen %' 80 
  }
}

on *:sockopen:http.head-*: {
  if ($sockerr) { echo 10 -s * $gettok($sockname,2-,45) $+ : $sockerr $sock($sockname).wsmsg | return }
  sockwrite -tn $sockname HEAD / HTTP/1.0 | sockwrite -tn $sockname $crlf
}
on *:sockread:http.head-*: {
  var %' , %. = $gettok($sockname,2-,45) 
  if ($sockerr) { echo 10 -s * %. $+ : $sockerr $sock($sockname).wmsg | return }
  sockread %' | tokenize 32 %'
  if (HTTP/1.* iswm $1) { echo 10 -s Header from %. }
  elseif ($istok(Connection: close;Connection: Keep-Alive,$1-2,59)) { echo 10 -s End Of Header from %. | sockclose $sockname | linesep -s }
  else { echo 10 -s $str($chr(160),3) * %. $+ : %' }
}

Comments

Sign in to comment.
www-   -  Apr 25, 2005

original idea

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.