Improve: using native http request

This commit is contained in:
Dreamacro
2018-06-14 01:00:58 +08:00
parent 6e2b9edb45
commit 47e038cf18
12 changed files with 169 additions and 96 deletions

View File

@ -12,13 +12,8 @@ type DirectAdapter struct {
conn net.Conn
}
// Writer is used to output network traffic
func (d *DirectAdapter) Writer() io.Writer {
return d.conn
}
// Reader is used to input network traffic
func (d *DirectAdapter) Reader() io.Reader {
// ReadWriter is used to handle network traffic
func (d *DirectAdapter) ReadWriter() io.ReadWriter {
return d.conn
}
@ -27,6 +22,11 @@ func (d *DirectAdapter) Close() {
d.conn.Close()
}
// Close is used to close connection
func (d *DirectAdapter) Conn() net.Conn {
return d.conn
}
type Direct struct {
}