In computer networks, a proxy server is a server (a computer system or an application program) that acts as an intermediary for requests from clients seeking resources from other servers. A client connects to the proxy server, requesting some service, such as a file, connection, web page, or other resource, available from a different server. The proxy server evaluates the request according to its filtering rules. For example, it may filter traffic by IP address or protocol. If the request is validated by the filter, the proxy provides the resource by connecting to the relevant server and requesting the service on behalf of the client. A proxy server may optionally alter the client's request or the server's response, and sometimes it may serve the request without contacting the specified server. In this case, it 'caches' responses from the remote server, and returns subsequent requests for the same content directly.
Technically, a proxy server computer uses ports to filter connections between your computer and other networks (the internet). When you set your internet to use a proxy, your computer's data is sent to the proxy to be filtered, rather than directly to the internet. In turn, the proxy server receives the data, filters it for you (masking/changing certain variables), and then sends it to the internet using a different port.
There are several different types of proxy servers, designed for different purposes. Some proxy servers are as simple as an application (on a proxy computer) that is made to block common internet services. For example, a specialized http proxy is used to limit web access vs. a SMTP proxy, which is used to limit and filter email.