How do I go about doing this using Winsock and a windows XP system?

I've written some code that I know works in a non-proxy environment, but now with trying to test it here with the proxy it doesn't connect anymore. It fails here:

Code:
int ircConnect::connectToServer(char* serverName,int port)
{
	hostInf=gethostbyname(serverName);
	if(!hostInf)
	{
		closesocket(iSocket);
		return ec_HOST_ERROR;
	}

	memcpy(&sockAddr.sin_addr,hostInf->h_addr,4);
	sockAddr.sin_family=AF_INET;
	sockAddr.sin_port=htons(port);
	if(connect(iSocket,(const sockaddr*)&sockAddr,sizeof(sockAddr))==SOCKET_ERROR)
	{
		closesocket(iSocket);
		return ec_CONNECT_ERROR;
	}

	return ec_CONN_OK;
}
The bolded code is where it returns. WSAGetLastError returns WSAETIMEDOUT (10060).

So...how do I go about connecting to a proxy? I would assume I just use that same function to connect to the proxy...but then what? How do I send requests through the proxy to the IRC channel?