Add raw socket API
Move the port selection into configuration