// Simulate a simple server that reads data and returns something
// This is the server that will be protected and require a proxy to access it
Simulate a simple server that reads data and returns something
This is the server that will be protected and require a proxy to access it
// Simulate a simple server that reads data and returns something // This is the server that will be protected and require a proxy to access it
func (mps *MockProtectedServer) handleConn(conn *net.TCPConn) {
	for {
		bytes := make([]byte, 4096)
		i, err := conn.Read(bytes)
		if err != nil {
			fmt.Printf("PS: %s\n", err.Error())
			return
		}
		conn.Write(append([]byte(mps.ServerMessage+": "), bytes[0:i]...))
	}
}
func ( mps * MockProtectedServer ) handleConn ( conn * net . TCPConn ) { for { bytes := make ( [ ] byte , 4096 ) i , err := conn . Read ( bytes ) if err != nil { fmt . Printf ( " \n " , err . Error ( ) ) return } conn . Write ( append ( [ ] byte ( mps . ServerMessage + " " ) , bytes [ 0 : i ] ... ) ) } }
Simulate a simple server that reads data and returns something
This is the server that will be protected and require a proxy to access it
Simulate a simple server that reads data and returns something This is the server that will be protected and require a proxy to access it
// Read info from client // Write back some fake data