func socksLocalMagic(addr, server string, shadow func(net.Conn) net.Conn) {
	logf("SOCKS proxy %s <-> %s", addr, server)
	getAddr := func(c net.Conn) (socks.Addr, error) {
		addr, err := socks.Handshake(c)
		return addr, err
	}
	tcpLocalMagic(addr, server, shadow, getAddr)
}
Create a SOCKS server listening on addr and proxy to server.
package main
import (
	"github.com/ihciah/go-shadowsocks-magic/magic"
	"io"
	"net"
	"time"
	"github.com/ihciah/go-shadowsocks-magic/socks"
)
func socksLocal(addr, server string, shadow func(net.Conn) net.Conn) {
	logf("SOCKS proxy %s <-> %s", addr, server)
	tcpLocalMagic(addr, server, shadow, func(c net.Conn) (socks.Addr, error) { return socks.Handshake(c) })
}