title: Simple Local Proxy vb.net
body: <p>I made a proxy application to test.</p>
  
  <p>I am using TCP Listener.</p>
  
  <p>After accepting bytes(request) what should I do.</p>
  
  <p>Can I send these bytes using webclient?</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Thanks,</p>