mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 11:11:30 -04:00
format using go-1.19
This commit is contained in:
parent
9ce1de4eee
commit
5ef5142bb0
11 changed files with 34 additions and 27 deletions
|
@ -17,7 +17,6 @@ Transport as follows:
|
|||
|
||||
transport := snowflake_server.NewSnowflakeServer(certManager.GetCertificate)
|
||||
|
||||
|
||||
The Listen function starts a new listener, and Accept will return incoming Snowflake connections:
|
||||
|
||||
ln, err := transport.Listen(addr)
|
||||
|
@ -31,8 +30,6 @@ The Listen function starts a new listener, and Accept will return incoming Snowf
|
|||
}
|
||||
// handle conn
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
package snowflake_server
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ additional HTTP listener on port 80 to work with ACME.
|
|||
flag.PrintDefaults()
|
||||
}
|
||||
|
||||
//proxy copies data bidirectionally from one connection to another.
|
||||
// proxy copies data bidirectionally from one connection to another.
|
||||
func proxy(local *net.TCPConn, conn net.Conn) {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(2)
|
||||
|
@ -67,7 +67,7 @@ func proxy(local *net.TCPConn, conn net.Conn) {
|
|||
wg.Wait()
|
||||
}
|
||||
|
||||
//handleConn bidirectionally connects a client snowflake connection with an ORPort.
|
||||
// handleConn bidirectionally connects a client snowflake connection with an ORPort.
|
||||
func handleConn(conn net.Conn) error {
|
||||
addr := conn.RemoteAddr().String()
|
||||
statsChannel <- addr != ""
|
||||
|
@ -80,7 +80,7 @@ func handleConn(conn net.Conn) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
//acceptLoop accepts incoming client snowflake connection and passes them to a handler function.
|
||||
// acceptLoop accepts incoming client snowflake connection and passes them to a handler function.
|
||||
func acceptLoop(ln net.Listener) {
|
||||
for {
|
||||
conn, err := ln.Accept()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue