1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00
v2fly/vray.go

40 lines
676 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
}
func NewVRay() *VRay {
ray := new(VRay)
ray.Input = make(chan []byte, 128)
ray.Output = make(chan []byte, 128)
return ray
}
type OutboundVRay interface {
OutboundInput() <-chan []byte
OutboundOutput() chan<- []byte
}
type InboundVRay interface {
InboundInput() chan<- []byte
OutboundOutput() <-chan []byte
}
func (ray *VRay) OutboundInput() <-chan []byte {
return ray.Input
}
func (ray *VRay) OutboundOutput() chan<- []byte {
return ray.Output
}
func (ray *VRay) InboundInput() chan<- []byte {
return ray.Input
}
func (ray *VRay) InboundOutput() <-chan []byte {
return ray.Output
}