mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
Hi.

I am traying to connect to this link http://www.orbital.pt/atocar.php but i don´t know why the site is nor responding nothing.

The HTTP header is this one:

GET /atocar.php HTTP/1.1
Host: www.orbital.pt
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive

The code that i have done is this one :

alias orbital3 {
Sockclose Orbital3
SockOpen Orbital3 www.orbital.pt 80
}

On *:sockopen:Orbital3:{
if ($sockerr) {
/echo -s XBC Socket Error Falha na conecção (# $+ $sock($sockname).wserr $+ ) $sock($sockname).wsmsg
}
else {
sockwrite -n Orbital3 GET /atocar.php HTTP/1.1
sockwrite -n Orbital3 Host: www.orbital.pt
sockwrite -n Orbital3 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0.12
sockwrite -n Orbital3 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
sockwrite -n Orbital3 Accept-Language: pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
sockwrite -n Orbital3 Accept-Encoding: gzip,deflate
sockwrite -n Orbital3 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
sockwrite -n Orbital3 Keep-Alive: 300
sockwrite -n Orbital3 Connection: keep-alive
sockwrite -n Orbital3 Referer: http://www.orbital.pt/

}
}

on *:sockread:Orbital3: {
set -u0 %Bytes 900
sockread $var( %Bytes, 1).value &data
echo -s $SockName
echo -s $bvar( &data, 0) $bvar( &data, 1, %Bytes).text
}

on *:sockclose:Orbital3: {
echo -s $SockName close
}


Thanks for all

Last edited by Miguel_A; 27/09/07 12:46 AM.
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508

Code:
alias orbital3 {
  Sockclose Orbital3
  SockOpen Orbital3 www.orbital.pt 80
}

On *:sockopen:Orbital3:{
  if ($sockerr) {
    echo -s XBC Socket Error Falha na conecção (# $+ $sock($sockname).wserr $+ ) $sock($sockname).wsmsg
    return
  }
  sockwrite -n Orbital3 GET /atocar.php HTTP/1.0
  sockwrite Orbital3 Host: www.orbital.pt $+ $str($crlf,2)
}

on *:sockread:Orbital3: {
  sockread 900 &data
  echo -s $SockName
  echo -s $bvar(&data,1-).text
}

on *:sockclose:Orbital3: {
  echo -s $SockName close
}

Joined: Aug 2003
Posts: 144
M
Vogon poet
OP Offline
Vogon poet
M
Joined: Aug 2003
Posts: 144
humm thanks
i always forget the two $crlf that must send at the end.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just as a note, part of your problem may have been that you were using HTTP 1.1 instead of 1.0. That can sometimes give you problems.


Invision Support
#Invision on irc.irchighway.net
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Well, I changed to HTTP/1.0 because experimented from editbox and its easier... wink
I don't know if the "http://" was included in OPs sockopen/sockwrite events because this board adds them to www.host.net strings, but I think that may have been the problem.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Originally Posted By: deegee
I don't know if the "http://" was included in OPs sockopen/sockwrite events because this board adds them to www.host.net strings


Yet another reason to use CODE tags (the # button above the box you type in). smile

* The info on how to use it is for the OP, not you deegee. wink


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
You can actually click the "Quote" button on a post to check that wink

Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Cool, thanks for that info laugh


Link Copied to Clipboard