<p>Run the AutoConnect site using the externally ensured ESP 8266 WebServer. User's added URI handler response can be included in handleClient method.
<p>Run the AutoConnect site using the externally ensured ESP8266WebServer.</p>
<p>The <ahref="index.html#handleclient"><strong>handleClient</strong></a> function of AutoConnect can include the response of the URI handler added by the user using the "<em>on</em>" function of ESP8266WebServer. If ESP8266WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the <ahref="../api.me#host"><strong>host</strong></a> function.
<dlclass="apidl">
<dt><strong>Parameters</strong></dt>
<dd><spanclass="apidef">webServer</span>A reference of ESP8266WebServer instance.</dd>
<p>Starts establishing WiFi connection. Before establishing, start the Web server and DNS server for the captive portal. Then begins connection establishment in WIFI_STA mode. If connection can not established with the specified SSID and password, switch to WIFI_AP_STA mode and activate SoftAP.
<p>Starts establishing the WiFi connection.<br/>
AutoConnect first invokes <em>WiFi.begin</em>. If the case of SSID and Password missing, its <em>WiFi.begin</em> has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer will be started immediately after the first <em>WiFi.beign</em> regardless of the result.</p>
<p>The captive portal will not be started if the connection has been established with first <em>WiFi.begin</em>. If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
<dlclass="apidl">
<dt><strong>Parameters</strong></dt>
<dd><spanclass="apidef">ssid</span>SSID to be connected.</dd>
<p>Set SoftAP's WiFi configuration and static IP configuration.
<dlclass="apidl">
<dt><strong>Parameters</strong></dt>
<dd><spanclass="apidef">config</span>Reference to AutoConnectConfig containing SoftAP's parameters.</dd>
<dd><spanclass="apidef">config</span>Reference to <ahref="index.html#autoconnectconfig"><strong>AutoConnectConfig</strong></a> containing SoftAP's parameters and static IP parameters.</dd>
<dd><spanclass="apidef">ap</span>SSID for SoftAP. The default value is <strong>esp8266ap</strong>.</dd>
<dd><spanclass="apidef">password</span>Password for SodtAP. The default value is <strong>12345678</strong>.</dd>
<p>Handling for the AutoConnect web interface. Invoke the handleClient of the parent web server to process client request of the AutoConnect WEB interface. No effects when the web server is not available.</p>
<p>Process the AutoConnect menu interface. It will be processed the client request too contained in the user sketch handler by calling the host <em>handleClient::ESP8266WebServer</em> from the Autoconnect internally.</p>
AutoConnect default constructor. This entry activates WebServer internally and the web server is allocated internal.
AutoConnect default constructor. This entry internally allocates the ESP8266WebServer and is activated internally.
```cpp
AutoConnect(ESP8266WebServer& webServer)
```
Run the AutoConnect site using the externally ensured ESP 8266 WebServer. User's added URI handler response can be included in handleClient method.
Run the AutoConnect site using the externally ensured ESP8266WebServer.
The [**handleClient**](api.md#handleclient) function of AutoConnect can include the response of the URI handler added by the user using the "*on*" function of ESP8266WebServer. If ESP8266WebServer is assigned internally by AutoConnect, the sketch can obtain that reference with the [**host**](api.me#host) function.
<dlclass="apidl">
<dt>**Parameters**</dt>
<dd><spanclass="apidef">webServer</span>A reference of ESP8266WebServer instance.</dd>
bool begin(const char* ssid, const char* passphraase, unsinged long timeout)
```
Starts establishing WiFi connection. Before establishing, start the Web server and DNS server for the captive portal. Then begins connection establishment in WIFI_STA mode. If connection can not established with the specified SSID and password, switch to WIFI_AP_STA mode and activate SoftAP.
Starts establishing the WiFi connection.
AutoConnect first invokes *WiFi.begin*. If the case of SSID and Password missing, its *WiFi.begin* has no SSID and Password. The WiFi mode at this time is WIFI_STA. Then ESP8266WebServer will be started immediately after the first *WiFi.beign* regardless of the result.
The captive portal will not be started if the connection has been established with first *WiFi.begin*. If the connection cannot establish, switch to WIFI_AP_STA mode and activate SoftAP. Then DNS server starts.
<dlclass="apidl">
<dt>**Parameters**</dt>
<dd><spanclass="apidef">ssid</span>SSID to be connected.</dd>
Set SoftAP's WiFi configuration and static IP configuration.
<dlclass="apidl">
<dt>**Parameters**</dt>
<dd><spanclass="apidef">config</span>Reference to AutoConnectConfig containing SoftAP's parameters.</dd>
<dd><spanclass="apidef">config</span>Reference to [**AutoConnectConfig**](api.md#autoconnectconfig) containing SoftAP's parameters and static IP parameters.</dd>
<dd><spanclass="apidef">ap</span>SSID for SoftAP. The default value is **esp8266ap**.</dd>
<dd><spanclass="apidef">password</span>Password for SodtAP. The default value is **12345678**.</dd>
Handling for the AutoConnect web interface. Invoke the handleClient of the parent web server to process client request of the AutoConnect WEB interface. No effects when the web server is not available.
Process the AutoConnect menu interface. It will be processed the client request too contained in the user sketch handler by calling the host *handleClient::ESP8266WebServer* from the Autoconnect internally.
#### handleRequest
@ -127,7 +132,7 @@ Handling for the AutoConnect menu request.
void home(String uri)
```
Put a user site's home URI. The URI specified by home is linked from "HOME" in the AutoConnect portal menu.
Put a user site's home URI. The URI specified by home is linked from "HOME" in the AutoConnect menu.
<dlclass="apidl">
<dt>**Parameters**</dt>
<dd><spanclass="apidef">uri</span> A URI string of user site's home path.</dd>