moved the socket open/close to the netpipe function
For so few actions the setup/shutdown functions seems overkill
Strip newlines from empty input

This is to break the loop if we receive an "empty" message. When
piping a message to netcat in many cases a newline on the end.
Adding a rstrip('\r\n') when checking the input we don't return true
if the message contains only a newline, but no actual content
Socket settings moved from constants to configuration file