mIRC Home    About    Download    Register    News    Help

Topic Options
#264728 - 07/01/19 11:58 PM SOCKET ISSUE - MIRC
Aiden Offline
Bowl of petunias

Registered: 07/01/19
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?


Edited by Aiden (08/01/19 12:02 AM)

Top
#264729 - 08/01/19 12:02 AM Re: SOCKET ISSUE - MIRC [Re: Aiden]
FroggieDaFrog Offline
Hoopy frood

Registered: 16/04/10
Posts: 910
Loc: USA
1: Capitalize GET
2: Its HTTP/1.1 not HTML/x.x


Edited by FroggieDaFrog (08/01/19 12:03 AM)
_________________________
I am SReject
My Stuff

Top
#264731 - 08/01/19 12:23 AM Re: SOCKET ISSUE - MIRC [Re: FroggieDaFrog]
Aiden Offline
Bowl of petunias

Registered: 07/01/19
Posts: 2
Changing it from 1.0 to 1.1 fixed it. Thanks


Edited by Aiden (08/01/19 12:24 AM)

Top