Both a proxy server and a gateway route traffic from inside a network to the Internet. A gateway, however, is more like a door to get to the Internet, while a proxy server acts like a wall that bars the inside of the network from being exposed to the Internet. A proxy server filters which connection is allowed, while a gateway doesn't do any filtering.
For two networks to communicate, a gateway must be provided from each network. The gateway defines what is internal to the network and what is external. If a computer needs to communicate with another computer outside the network, it must be configured with a gateway to gain access outside the network. Without a gateway, a computer will be unable to get out, like someone locked inside a house.
A proxy server represents the network from the outside. Any user trying to gain access to any computer inside a network with a proxy will only see the IP address of the proxy server. It acts like a barrier to hide your network by configuring the Internet options of computers within the network to first point to the proxy server before going out to the Internet. It keeps computers inside the network anonymous.
A proxy server that does not do any filtering is like a gateway, simply passing on requests from the computer to the Internet. A proxy server, however, is a more powerful networking component that can act as a gateway while protecting the network from outside threats. A gateway always risks exposing an internal network to the Internet because it does no filtering. It merely routes information from within the network to the outside.
A gateway cannot block websites. As long as the gateway settings in the computer are configured properly, you can access any website from the network to the Internet. A proxy server can block websites by redirecting your web requests to a website internal to the network. Administrators can configure certain websites to be blocked all the time or during office hours. Accessing any of those blocked websites will redirect you to a custom-made page stating that you are accessing a blocked website.
Other Proxy Server Functions
Proxy servers can also cache websites that are frequently accessed by computers. It can track website hits and use this data to store information of websites you visit daily. The next time you try to go to a website you typically access, the proxy server will return to you the cache information of the website instead of going out to the Internet. This effectively reduces traffic going out of the network and saves bandwidth resources. The cache property of a proxy server can be set to refresh every few times to get new content from the Internet.