This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

http auth

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

http auth

Post by Ofloo »

http auth using the http lib extention..
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

never mind allready found a way

Code: Select all

#!/usr/bin/tclsh
##################################
# create file domain.txt
# file should look like this without the '#' :
##################################
#<id> <host>
##################################
#{0000000} {domain.tld}
#{0000000} {domain.tld}
##################################

set username "<username>"
set password "<password>"

package require base64
set crypt [base64::encode $username:$password]

proc ipupdater {crypt ipaddr} {
  set rf [open domain.txt r]
  foreach x [split [read $rf] \n] {
    if {![string equal {} [lindex $x 1]]} {
      if {![catch {socket dynamic.zoneedit.com 80} s]} {
        puts $s "GET /auth/dynamic.html?host=[lindex $x 1]&dnsto=$ipaddr&id=[lindex $x 0] HTTP/1.1"
        puts $s "Host: dynamic.zoneedit.com"
        puts $s "User-Agent: ipupdater"
        puts $s "Authorization: Basic $crypt"
        puts $s "\n\r\n\r"

    puts "WEB <-- GET /auth/dynamic.html?host=[lindex $x 1]&dnsto=$ipaddr&id=[lindex $x 0] HTTP/1.1"
    puts "WEB <-- Host: dynamic.zoneedit.com"
    puts "WEB <-- User-Agent: ipupdater"
    puts "WEB <-- Keep-Alive: 300"
    puts "WEB <-- Authorization: Basic $crypt"
    puts "WEB <-- <crlf><crlf>"
    flush $s
    while {![eof $s]} {
      gets $s x
      regsub -all {<(.|\n)*?>} $x {} x
      if {![string equal {} $x]} {
        puts "WEB --> $x"
      }
    }
    close $s
      }
    }
  }
  close $rf
}

ipupdater $crypt $argv 


incase any one wants to know how ;) or if one knows a beter way..
XplaiN but think of me as stupid
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Have you ever read "The Manual"?
Locked