shadowsocks-go
shadowsocks-go copied to clipboard
cmd/shadowsocks-server: code refactor
Split codes into different files to get clearer interfaces and structures, with only minor modifications.
thanx for your contribute. But have you changed any core logic?
no core logic was changed, just some formal parameter changes on specific functions for decoupling,
like function run
runUDP
handleConnection
updatePasswd
. function updatePasswd
was changed into method of type PasswdManager
as it is only a series of manipulations on the type.
another consideration is functions in util.go
should be small independent tools that don't rely on functions in the other three files. (but in fact still rely on global variables defined in server.go
)