ขอยกเครดิตให้เว็บนี้ก่อนเลยละกัน เดี๋ยวโดนละเมิดลิขสิทธิ์
Credit [You must be registered and logged in to see this link.]
วันนี้ช่วงเย็น นั่งหาข้อมูลทั่วโลกของการเกี่ยวกับการส่งข้อมูลที่เรียกว่า packet เลยนึกการทำงานของเว็บเซิฟเวอร์ หรือโปรแกรมจำลองเซิฟเวอร์บนเครื่องพีซีที่บ้าน
วิธีทดสอบนะครับ [You must be registered and logged in to see this image.]
Credit [You must be registered and logged in to see this link.]
วันนี้ช่วงเย็น นั่งหาข้อมูลทั่วโลกของการเกี่ยวกับการส่งข้อมูลที่เรียกว่า packet เลยนึกการทำงานของเว็บเซิฟเวอร์ หรือโปรแกรมจำลองเซิฟเวอร์บนเครื่องพีซีที่บ้าน
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#include <INet.au3>
$internalip = @IPAddress1 ;<<<<<<<<<<<<<<ส่วนนี้ห้ามแก้นะครับ
$externalip = _GetIP()
$port = 32132 ;<<<<<<<<<<<<< แก้ port ตรงนี้ครับ
$gui = GUICreate('Header Grabber' ,600,400)
$text_internalip = GUICtrlCreateLabel("(You proxy connect to this) Internal IP: " & $internalip, 10, 5)
$text_externalip = GUICtrlCreateLabel("(They proxy connect to this) External IP: " & $externalip, 10, 20)
$edit = GUICtrlCreateEdit('',10,40,580,350)
GUISetState()
TCPStartUp()
$MainSocket = TCPListen($internalip, $port)
While 1
$msg = GUIGetMsg()
$ConnectedSocket = TCPAccept($MainSocket)
If $msg = $GUI_EVENT_CLOSE Then close()
If $ConnectedSocket >= 0 Then
$recv = TCPRecv($ConnectedSocket, 2048)
While $recv <> ''
GUICtrlSetData($edit, GUICtrlRead($edit) & '<--- START COPY --->' & @CRLF & @CRLF & $recv & @CRLF & '<--- END COPY --->' & @CRLF & @CRLF)
FileWrite("HGLog.txt", GUICtrlRead($edit))
TCPSend($ConnectedSocket, '<html>')
TCPSend($ConnectedSocket, '<head>')
TCPSend($ConnectedSocket, '<title>Header Grabbed</title>')
TCPSend($ConnectedSocket, '</head>')
TCPSend($ConnectedSocket, '<body>')
TCPSend($ConnectedSocket, '<center><strong><font size="5" color="red">ดีจ้า Edit by Rolovely <a href="http://pssix.forumotion.com">http://pssix.forumotion.com</a></font></strong></center>')
TCPSend($ConnectedSocket, '<center><strong><font size="5" color="red">Credit <a href="http://www.autoitscript.com/forum/topic/47184-header-grabber/">http://www.autoitscript.com/forum/topic/47184-header-grabber/</a></font></strong></center>')
TCPSend($ConnectedSocket, '<center><strong><font size="5">Thank you for your support!</font></strong></center>')
TCPSend($ConnectedSocket, '</body>')
TCPSend($ConnectedSocket, '</html>')
TCPCloseSocket($ConnectedSocket)
ExitLoop
WEnd
EndIf
WEnd
Func close()
If $ConnectedSocket >= 0 Then TCPCloseSocket($ConnectedSocket)
TCPShutDown()
Exit
EndFunc
วิธีทดสอบนะครับ [You must be registered and logged in to see this image.]