简单的本地代理vb.net

时间:2014-07-11 09:34:39

标签: vb.net proxy local

我做了一个代理申请来测试。

我正在使用TCP侦听器。

接受字节(请求)后,我该怎么做。

我可以使用webclient发送这些字节吗?

Module MyTcpListener
Sub Main()
    Task.Run(Sub()
                 Dim server As Sockets.TcpListener
                 server = Nothing
                 Try
                     Dim port As Int32 = 8080
                     Dim localAddr As IPAddress = IPAddress.Any
                     server = New Sockets.TcpListener(localAddr, port)
                     server.Start()
                     Do
                         Dim data = server.AcceptTcpClient()
                         Dim bytes(data.ReceiveBufferSize - 1) As Byte
                         data.Client.Receive(bytes)
                         'Here how can i send abytes using webclient or tcpclient
                         data.Close()
                     Loop
                 Catch ex As Exception

                 End Try
             End Sub)
    Do
        System.Threading.Thread.Sleep(10000)
    Loop
End Sub
End Module

谢谢,

0 个答案:

没有答案