- Private Sub Form_Load()
Winsock1(0).Listen
For i = 1 To 255
Load Winsock1(i)
Load Winsock2(i)
Winsock1(i).Close
Next
End Sub - Private Sub Form_Unload(Cancel As Integer)
Winsock1(0).Close
Unload Me
End Sub - Private Sub Winsock1_ConnectionRequest(Index As Integer, ByVal requestID As Long)
For i = 1 To 255
If Winsock1(i).State = sckClosed Then
Winsock1(i).Accept requestID
Exit For
End If
Next
End Sub - Private Sub Winsock1_DataArrival(Index As Integer, ByVal bytesTotal As Long)
'On Error GoTo OnError
Dim Dat As String
Winsock1(Index).GetData Dat
Dim ProxyTmp
Dim ProxyFile() As Byte
ProxyTmp = Split(Dat, " ")
Dim UrlTemp
Dim UrlW As String
UrlTemp = Split(ProxyTmp(1), "/")
i = 0 - UrlW = UrlTemp(2)
Winsock2(Index).Close
用VB制作简易的代理服务器代码
最新推荐文章于 2024-09-04 11:48:50 发布
该博客展示了如何使用VB编写一个简易的代理服务器。通过监听端口、接受连接请求和数据传输,实现客户端与目标服务器之间的通信。尽管存在内存消耗问题,但此示例有助于理解代理服务器的基本工作原理。
摘要由CSDN通过智能技术生成