Implement the WebsocketTransport functionality to facilitate the operation of WebSocket connections. The implementation must ensure that it meets the following requirements to pass the provided test suite:
Listening for Connections: Create a method Listen(maddr ma.Multiaddr) (Listener, error) within WebsocketTransport that:
Accepts a multiaddress as an argument and listens for incoming WebSocket connections.
Returns a Listener interface that has the Accept() method.
Accepting Connections: The Listener interface must include:
Accept() (Conn, error): This method should accept and return a Conn interface representing the established WebSocket connection.
Dialing Connections: Implement a Dialer method in WebsocketTransport that provides a way to establish outgoing WebSocket connections:
Dialer(options interface{}) (Dialer, error): The method should return a Dialer that has the Dial(maddr ma.Multiaddr) (Conn, error) method.
Connection Interface: Create a Conn interface that includes:
Write([]byte) (int, error): Written bytes should be sent over the WebSocket connection.
Ensure that writing a nil slice to the connection results in zero bytes being written.
When reading from the connection after sending a nil slice, you should receive 0 bytes and detect an io.EOF error.
Implement your solution in the /app/ directory, ensuring it satisfies the above requirements so that all specified tests in the provided test code pass successfully.
Important: declare your solution in package websocket (the test file uses package websocket, so the implementation must use the matching package name).