mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-10 23:03:05 +02:00
should resolve #46
This commit is contained in:
parent
19466b5625
commit
362cf6c254
8 changed files with 39 additions and 24 deletions
|
@ -10,18 +10,19 @@ import (
|
|||
|
||||
type WebSocket struct {
|
||||
id string
|
||||
address string
|
||||
ws *WebSocketHandler
|
||||
connection *websocket.Conn
|
||||
mu sync.Mutex
|
||||
}
|
||||
|
||||
func (socket *WebSocket) Address() *string {
|
||||
remote := socket.connection.RemoteAddr()
|
||||
address := strings.SplitN(remote.String(), ":", -1)
|
||||
func (socket *WebSocket) Address() string {
|
||||
//remote := socket.connection.RemoteAddr()
|
||||
address := strings.SplitN(socket.address, ":", -1)
|
||||
if len(address[0]) < 1 {
|
||||
return nil
|
||||
return socket.address
|
||||
}
|
||||
return &address[0]
|
||||
return address[0]
|
||||
}
|
||||
|
||||
func (socket *WebSocket) Send(v interface{}) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue