Пример #1
0
func (t *traffic) ClientNewData(c lib.SSClienter, data []byte) (err error) {
	//do anything with data
	_, err = c.Remote().Write(data)
	if err != nil {
		log.Println(errors.New(err.Error()))
		c.Remote().Close()
	}
	return
}
Пример #2
0
func (t *traffic) RemoteNewData(c lib.SSClienter, data []byte) (err error) {

	_, err = c.Write(data)
	if err != nil {
		if err != io.ErrClosedPipe {
			log.Println(errors.New(err.Error()))
		}
		c.Close()
	}
	return
}
Пример #3
0
func (t *traffic) RemoteReadErr(c lib.SSClienter, err error) {
	c.Close()
}