Fix missing require

Fixed missing 'net' require in proxy.js that caused a crash.
Added extra logging in protocol.js.