# SetHTTPHost

## Description

Sets the domain of the host you want to connect to, for example to access www.thegamecreators.com/index.php you would use a host value of www.thegamecreators.com, do not include the http: that usually goes before it. Note that trying to use a specific port with www.thegamecreators.com:8080 may be ignored on some platforms and port 80 will be used in these cases.
When exporting to HTML5 note that web browsers limit which servers you can connect to. By default you are limited to files hosted by the same server as your app. However if the server sends an Access-Control-Allow-Origin header in its response that allows your app's server, then the browser will let you connect to it.

## Definition

integer SetHTTPHost( iHTTP, szHost, iSecure )

UINT agk::SetHTTPHost( UINT iHTTP, const char *szHost, int iSecure )

integer SetHTTPHost( iHTTP, szHost, iSecure, szUser, szPass )

UINT agk::SetHTTPHost( UINT iHTTP, const char *szHost, int iSecure, const char *szUser, const char *szPass )

## Parameters

- iHTTP - The ID of the connection to set.
- szHost - The domain to connect to.
- iSecure - Set to 1 to use an HTTPS secure connection, 0 to use a standard HTTP connection.
- szUser - The username to send to the server.
- szPass - The password to send to the server.