WebSockets won't accomplish what you want as you'll need a server. The B4A WebSocket library is client-only. You should be able to accomplish what you want using the walkie-talkie example but instead of using WiFi or Bluetooth, use WifiDirect.
In the walkie-talkie example, you feed the AsyncStreams object an InputStream and an OutputStream. When you use WiFi, these streams come from the Sockets you are using over WiFi. When using Bluetooth, these streams come from Serial object used to manage the Bluetooth connection. In order to use WiFiDirect, just supply AsyncStreams with the InputStream and OutputStream you get from the WiFiDirect library (after having established a connection). That's the great thing about Asyncstreams; they are connection-agnostic. So long as it gets an InputStream and an OutputStream, it will work, regardless of the connection.