Пример #1
0
func handleConn(conn net.Conn) {
	remote, err := client.Dial()
	if err != nil {
		log.W("Cannot dail remote")
		conn.Close()
		return
	}

	go core.ConnCopy(conn, remote)
	core.ConnCopy(remote, conn)

	log.I("Close connection " + conn.RemoteAddr().String())
}
Пример #2
0
func handleConn(conn net.Conn) {
	log.I("Bridge accept: ", conn.RemoteAddr())

	remote, err := net.Dial("tcp", "127.0.0.1:1080")
	if err != nil {
		log.W("Cannot dail remote ", err)
		conn.Close()
		return
	}

	go core.ConnCopy(conn, remote)
	core.ConnCopy(remote, conn)

	log.I("Bridge closed: ", conn.RemoteAddr())
}