mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
9 years ago
|
package ray
|
||
9 years ago
|
|
||
9 years ago
|
import (
|
||
|
"github.com/v2ray/v2ray-core/common/alloc"
|
||
|
)
|
||
|
|
||
9 years ago
|
// OutboundRay is a transport interface for outbound connections.
|
||
9 years ago
|
type OutboundRay interface {
|
||
9 years ago
|
// OutboundInput provides a stream for the input of the outbound connection.
|
||
|
// The outbound connection shall write all the input until it is closed.
|
||
9 years ago
|
OutboundInput() <-chan *alloc.Buffer
|
||
9 years ago
|
|
||
|
// OutboundOutput provides a stream to retrieve the response from the
|
||
|
// outbound connection. The outbound connection shall close the channel
|
||
|
// after all responses are receivced and put into the channel.
|
||
9 years ago
|
OutboundOutput() chan<- *alloc.Buffer
|
||
9 years ago
|
}
|
||
|
|
||
9 years ago
|
// InboundRay is a transport interface for inbound connections.
|
||
9 years ago
|
type InboundRay interface {
|
||
9 years ago
|
// InboundInput provides a stream to retrieve the request from client.
|
||
|
// The inbound connection shall close the channel after the entire request
|
||
|
// is received and put into the channel.
|
||
9 years ago
|
InboundInput() chan<- *alloc.Buffer
|
||
9 years ago
|
|
||
|
// InboudBound provides a stream of data for the inbound connection to write
|
||
|
// as response. The inbound connection shall write all the data from the
|
||
|
// channel until it is closed.
|
||
9 years ago
|
InboundOutput() <-chan *alloc.Buffer
|
||
9 years ago
|
}
|
||
|
|
||
9 years ago
|
// Ray is an internal tranport channel bewteen inbound and outbound connection.
|
||
|
type Ray interface {
|
||
|
InboundRay
|
||
|
OutboundRay
|
||
|
}
|