mIRC Home    About    Download    Register    News    Help

Print Thread
#205320 19/10/08 09:30 PM
Joined: Sep 2007
Posts: 28
M
Miyako Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Sep 2007
Posts: 28
I'm trying to connect to: http://miyako.lhosting.info/n00b/readme.htm
The problem is, it doesn't work shocked

This is what I have:

Code:
alias testjee { sockopen test miyako.lhosting.info 80 }

on *:sockopen:test: {
 if ($sockerr) { return }
  sockwrite -n $sockname GET /n00b/readme.htm HTTP/1.1
  sockwrite -n $sockname Host: http://miyako.lhosting.info
  sockwrite -n $sockname $crlf
}

on *:sockread:test: {
 if ($sockerr) { return }
  sockread %t
  echo -a %t
}

Miyako #205324 19/10/08 11:53 PM
Joined: May 2008
Posts: 2
J
Bowl of petunias
Offline
Bowl of petunias
J
Joined: May 2008
Posts: 2
Try making the variable first?

Code:
on *:SOCKREAD:test:{
  if ($sockerr) {
    if (!$window(@READ)) { window -z @READ }
    aline -h @READ Socket Error - $sock($sockname).wmsg ( $+ $v1 $+ ) 
  }
  else {
    var %t 
    sockread %t
    aline -hp @READ %t $crlf
  }
}


also, you don't need the http:// protocol in the Host:

Last edited by JoshR; 19/10/08 11:54 PM.
JoshR #205343 20/10/08 04:43 PM
Joined: Sep 2007
Posts: 28
M
Miyako Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Sep 2007
Posts: 28
The variable is correct (also the http://), but I get a forwarded (errorcode 302 iirc) site. Dunno y that happens and if someone could fix it.

Miyako #205407 22/10/08 08:22 AM
Joined: Sep 2007
Posts: 28
M
Miyako Offline OP
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Sep 2007
Posts: 28
Solved, User-Agent req-header should be included smile


Link Copied to Clipboard