tcp anfrage & antowrt an server

  • Hallo mein Problem ist ich würde gerne mit autoit per tcp auf einen server conencten und dann nachruchten zurückbekommen.

    Hier ist mein aktueller scriopt klappt aber leider noch nicht. Hab mir Forum schon durchgeschaut aber da ist ja nur beispiel mit autoit server wie abe jetzt mit einem web server?

    Spoiler anzeigen
    [autoit]


    ;Client
    Global $IP = "85.114.135.24"
    Global $PORT = 80
    Global $Connect = -1, $Recv

    TCPStartup()

    While $Connect = -1
    $Connect = TCPConnect($IP, $PORT)
    WEnd

    While $Recv = ''
    $Recv = TCPSend($Connect,"GET /index.php HTTP/1.1\n85.114.135.24");

    WEnd

    ToolTip($Recv)
    Sleep(2000)
    ToolTip("")

    TCPCloseSocket($Connect)
    TCPShutdown()

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit]

    Jeoch bekomme ich irgendwie nur "38" zurück jedoch sollte ich das hier ca bekommen:

    Spoiler anzeigen

    HTTP/1.1 200 OK
    Server: Apache/1.3.29 (Unix) PHP/4.3.4
    Content-Length: (Größe von infotext.html in Byte)
    Content-Language: de (nach ISO 639 und ISO 3166)
    Content-Type: text/html
    Connection: close

    (Inhalt von index.php)

  • mhh sry habs 20mins später nach ausprobieren gefunden aber hab gleich noch ne frage wie mach ich dass er alles unbegrenz anzeigt und man nicht eingibt wieviele stellen der nur anzeigen soll?

    Spoiler anzeigen
    [autoit]


    Global $IP = "85.114.135.24"
    Global $PORT = 80
    Global $Connect = -1, $Recv

    TCPStartup()

    While $Connect = -1
    $Connect = TCPConnect($IP, $PORT)
    WEnd

    $sendvar = "GET /news.php HTTP/1.0" & @CRLF & @CRLF

    [/autoit] [autoit][/autoit] [autoit]

    TCPSend($Connect, $sendvar);

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While $Recv = ''
    $Recv = TCPRecv($Connect,99999999999) ; <- das hier meine ich !!
    WEnd


    FileWrite("http.log",$recv)

    TCPCloseSocket($Connect)
    TCPShutdown()

    [/autoit]

    Einmal editiert, zuletzt von I3iLLiG (13. Oktober 2007 um 03:16)