backported http-socket-modifier1/2