fix line reading on empty streams
ws refactored, kept separated from sktd
protect send with pcall