ウェブサーバーからデータを取得する mIRC 用のスクリプトを作成しています。そのコードは PHP を介して生成されます。
ブラウザ(Firefox)経由で接続すると問題なく動作します。しかし、mIRC ソケット経由で接続すると、サーバーは PHP コードの「コンパイル」に失敗します。他のテキストや html を取得することはできます。ウェブサーバー (litespeed) が私の http リクエストを認識していないようです (?!)
これは、サーバーに渡すヘッダー情報です。
sockwrite -n ccsw_sock_reg GET /ccsw/ccsw.php?action=register&username= $+ %ccsw_username_temp $+ &password= $+ %ccsw_username_temp HTTP/1.1
sockwrite -n ccsw_sock_reg Host: www.[HIDDEN].com
sockwrite -n ccsw_sock_reg Connection: close
sockwrite -n ccsw_sock_reg User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008052906 Firefox/3.0
sockwrite -n ccsw_sock_reg Accept-Encoding: gzip
sockwrite -n ccsw_sock_reg Accept:Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
sockwrite -n ccsw_sock_reg Accept-Language: en-us,en;q=0.5
sockwrite -n ccsw_sock_reg Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7
;sockwrite -n ccsw_sock_reg Cache-Control: no-cache
sockwrite -n ccsw_sock_reg Cache-Control: no-store, no-cache, must-revalidate
sockwrite -n ccsw_sock_reg Cache-Control: post-check=0, pre-check=0
sockwrite -n ccsw_sock_reg Pragma: no-cache
sockwrite -n ccsw_sock_reg $crlf
litespeed の代わりに apache サーバーを使用してみましたが、どちらも解決しません。PHPで生成されたコードをまだ表示できません。
いくつかのヘッダーがありませんか? まったく別の方法で行う必要がありますか?
アップデート:
mIRC コード:
alias testsock {
sockclose testsock
sockopen testsock www.[HIDDEN].com 80
}
on *:sockopen:testsock: {
sockwrite -nt testsock GET /ccsw/ccsw.php?action=register&username= $+ %ccsw_username_temp $+ &password= $+ %ccsw_username_temp HTTP/1.0
sockwrite -nt testsock Host: www.[HIDDEN].com
sockwrite -nt testsock $crlf
}
on *:sockread:testsock: {
%ccsw_content_start = 0
if ($sockerr > 0) return
sockread %temp
while ($sockbr) {
echo response: %temp
sockread %temp
}
}
応答:
reponse: HTTP/1.0 200 OK
reponse: Date: Thu, 02 May 2013 14:45:07 GMT
reponse: Server: LiteSpeed
reponse: Connection: close
reponse: X-Powered-By: PHP/5.2.17
reponse: Content-Type: text/html
reponse: Content-Length: 43
reponse:
そして、最後の "reponse: " の後、"reponse: true" で生成された php の行を取得する必要があります。