mirror of
https://github.com/therootcompany/telebit.git
synced 2025-12-24 06:18:46 +00:00
- added support for ConnByDomain which looks up existing WSS and registered domain - passed connection table to External Listener - on request, obtained hostname and map to domain, split the remote address and port (will go into an table eventually) - look up the domain and find the WSS connection - packed up the frame. - sent down the channel.
25 lines
464 B
Go
25 lines
464 B
Go
package packer
|
|
|
|
import "bytes"
|
|
|
|
//packerData -- Contains packer data
|
|
type packerData struct {
|
|
buffer *bytes.Buffer
|
|
}
|
|
|
|
func newPackerData() (p *packerData) {
|
|
p = new(packerData)
|
|
p.buffer = new(bytes.Buffer)
|
|
return
|
|
}
|
|
|
|
func (p packerData) AppendString(dataString string) (n int, err error) {
|
|
n, err = p.buffer.WriteString(dataString)
|
|
return
|
|
}
|
|
|
|
func (p packerData) AppendBytes(dataBytes []byte) (n int, err error) {
|
|
n, err = p.buffer.Write(dataBytes)
|
|
return
|
|
}
|