mIRC Home    About    Download    Register    News    Help

Print Thread
SOCKET ISSUE - MIRC #264728 07/01/19 11:58 PM
Joined: Jan 2019
Posts: 2
A
Aiden Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Jan 2019
Posts: 2
I'm trying to get contents of a page using socket.
Here is my code:
Code:
alias test {
  sockopen test decapi.me 80
}

on *:sockopen:test: {
  sockwrite -n $sockname get /twitch/followage/forsen/sodapoppin HTTP/1.0 
  sockwrite -n $sockname Host: decapi.me
  sockwrite -n $sockname
  
}

on *:sockread:test: {
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    var %temp
    sockread %temp
    echo %temp
  }
}

on *:text:!test:#:{
  test
}


However this is the output that I get:
Quote:

HTTP/1.1 400 Bad Request
Server: nginx-rc
Date: Mon, 07 Jan 2019 23:57:25 GMT
Content-Type: text/html
Content-Length: 173
Connection: close
<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>nginx/1.15.3</center>
</body>
</html>


Any idea how to fix this?

Last edited by Aiden; 08/01/19 12:02 AM.
Re: SOCKET ISSUE - MIRC [Re: Aiden] #264729 08/01/19 12:02 AM
Joined: Apr 2010
Posts: 921
F
FroggieDaFrog Online
Hoopy frood
Online
Hoopy frood
F
Joined: Apr 2010
Posts: 921
1: Capitalize GET
2: Its HTTP/1.1 not HTML/x.x

Last edited by FroggieDaFrog; 08/01/19 12:03 AM.

I am SReject
My Stuff
Re: SOCKET ISSUE - MIRC [Re: FroggieDaFrog] #264731 08/01/19 12:23 AM
Joined: Jan 2019
Posts: 2
A
Aiden Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
A
Joined: Jan 2019
Posts: 2
Changing it from 1.0 to 1.1 fixed it. Thanks

Last edited by Aiden; 08/01/19 12:24 AM.