add generic tcp proxying, fix #374