20 lines
386 B
Go
Raw Normal View History

2016-12-23 00:30:46 +01:00
package websocket
2016-08-13 21:44:36 +08:00
2016-10-02 23:43:58 +02:00
import (
"v2ray.com/core/common"
2016-10-02 23:43:58 +02:00
"v2ray.com/core/transport/internet"
2016-08-13 21:44:36 +08:00
)
2016-10-02 23:43:58 +02:00
2017-01-01 21:19:12 +01:00
func (c *Config) IsConnectionReuse() bool {
if c == nil || c.ConnectionReuse == nil {
2017-01-04 15:34:11 +01:00
return true
2016-10-17 14:35:13 +02:00
}
2017-01-01 21:19:12 +01:00
return c.ConnectionReuse.Enable
2016-10-17 14:35:13 +02:00
}
2016-10-02 23:43:58 +02:00
func init() {
common.Must(internet.RegisterProtocolConfigCreator(internet.TransportProtocol_WebSocket, func() interface{} {
2016-10-02 23:43:58 +02:00
return new(Config)
}))
2016-10-02 23:43:58 +02:00
}