Added Gateway support.

Added Gateway support.