1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 09:36:34 -05:00
v2fly/vray.go

37 lines
628 B
Go
Raw Normal View History

2015-09-09 18:50:21 -04:00
package core
type VRay struct {
Input chan []byte
Output chan []byte
}
2015-09-10 18:24:18 -04:00
func NewVRay() VRay {
return VRay{make(chan []byte, 128), make(chan []byte, 128)}
2015-09-09 18:50:21 -04:00
}
type OutboundVRay interface {
OutboundInput() <-chan []byte
OutboundOutput() chan<- []byte
}
type InboundVRay interface {
InboundInput() chan<- []byte
2015-09-10 18:24:18 -04:00
InboundOutput() <-chan []byte
2015-09-09 18:50:21 -04:00
}
2015-09-10 18:24:18 -04:00
func (ray VRay) OutboundInput() <-chan []byte {
2015-09-09 18:50:21 -04:00
return ray.Input
}
2015-09-10 18:24:18 -04:00
func (ray VRay) OutboundOutput() chan<- []byte {
2015-09-09 18:50:21 -04:00
return ray.Output
}
2015-09-10 18:24:18 -04:00
func (ray VRay) InboundInput() chan<- []byte {
2015-09-09 18:50:21 -04:00
return ray.Input
}
2015-09-10 18:24:18 -04:00
func (ray VRay) InboundOutput() <-chan []byte {
2015-09-09 18:50:21 -04:00
return ray.Output
}