2020
12-18
12-18
golang 通过ssh代理连接mysql的操作
我就废话不多说了,大家还是直接看代码吧~packagemainimport("bytes""context""database/sql""errors""fmt""github.com/go-sql-driver/mysql""golang.org/x/crypto/ssh""io""io/ioutil""net""os")typeViaSSHDialerstruct{client*ssh.Client_*context.Context}func(self*ViaSSHDialer)Dial(contextcontext.Context,addrstring)(net.Conn,error){returnself.client.Dial("tcp",addr)}typeremoteScr...
继续阅读 >