Adding the start of a protocol detecting gateway.
Merge pull request #684 from chirino/protocol-detecting-gateway

Adding the start of a protocol detecting gateway.