I would like to open a socket to http url (https://www.abc.co.uk:8433/open/url/client?username=123&password=456) using socket and connect and recv methods of socket.h.
The problems are that the url is using 8433 port and the remaining url (/open/url/client?username=123&password=456). Also using https url.
Dose anyone know how to do it? Long time ago, I had done the standard C coding, I forget.
int sock;
char url[1024];
struct sockaddr_in client;
struct hostent *h;
if ((sock = socket(AF_INET,SOCK_STREAM,0)) == -1)
{
perror("socket:");
return;
}
sprintf(url, "https://www.abc.co.uk:%d/open/url/client?username=123&password=456", 8443);
client.sin_family = AF_INET;
client.sin_port = htons(8443);
h = gethostbyname(url);
client.sin_addr.s_addr = inet_addr(h->h_addr_list[0]);