The wscli command supports both ws:// and wss:// protocols. The username and password parameters are optional and can be included if required for authentication.
Package main provides a simple WebSocket client that connects to a WebSocket server, optionally authenticating using basic authentication if credentials are embedded in the URL. The client supports sending messages from the command line and receiving messages from the server concurrently.
Usage:
go run main.go <WebSocket_URL>
The URL can include username and password for basic authentication, for example:
ws://user:password@localhost:8080/ws
The program also listens for system signals (e.g., SIGINT, SIGTERM) to gracefully shut down the WebSocket connection.