1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: support plain http protocol

This commit is contained in:
Delyan Angelov
2019-08-21 20:04:06 +03:00
committed by Alexander Medvednikov
parent e35ef3b83e
commit 51818346df
8 changed files with 103 additions and 35 deletions

View File

@ -134,7 +134,7 @@ void vschannel_init() {
tls_ctx.creds_initialized = TRUE;
}
INT request(CHAR *host, CHAR *req, CHAR *out)
INT request(INT iport, CHAR *host, CHAR *req, CHAR *out)
{
SecBuffer ExtraData;
SECURITY_STATUS Status;
@ -147,6 +147,8 @@ INT request(CHAR *host, CHAR *req, CHAR *out)
protocol = SP_PROT_TLS1_2_CLIENT;
port_number = iport;
// Connect to server.
if(connect_to_server(host, port_number)) {
printf("Error connecting to server\n");