You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
366 B
Go
25 lines
366 B
Go
package main
|
|
|
|
import (
|
|
"github.com/gorilla/websocket"
|
|
"sync"
|
|
"testing"
|
|
)
|
|
|
|
func TestWSServer(t *testing.T) {
|
|
runWSServer("0.0.0.0:14725", "/ws")
|
|
}
|
|
|
|
func TestWSClient(t *testing.T) {
|
|
ngin, nc := runWSClient("ws://127.0.0.1:14725/ws")
|
|
|
|
_ = nc.Send(websocket.TextMessage, []byte("hello world!"))
|
|
|
|
ngin.LogPrefix()
|
|
|
|
var wg sync.WaitGroup
|
|
wg.Add(1)
|
|
|
|
wg.Wait()
|
|
}
|