\hypertarget{group__client}{}\section{Client}
\label{group__client}\index{Client@{Client}}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structlws__client__connect__info}{lws\+\_\+client\+\_\+connect\+\_\+info}
\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__client_ga96f3dbad54b2853969cfa933d66871ce}{lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags} \{ {\bfseries L\+C\+C\+S\+C\+F\+\_\+\+U\+S\+E\+\_\+\+S\+SL} = (1 $<$$<$ 0), 
{\bfseries L\+C\+C\+S\+C\+F\+\_\+\+A\+L\+L\+O\+W\+\_\+\+S\+E\+L\+F\+S\+I\+G\+N\+ED} = (1 $<$$<$ 1), 
{\bfseries L\+C\+C\+S\+C\+F\+\_\+\+S\+K\+I\+P\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+C\+E\+R\+T\+\_\+\+H\+O\+S\+T\+N\+A\+M\+E\+\_\+\+C\+H\+E\+CK} = (1 $<$$<$ 2)
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws $\ast$ \hyperlink{group__client_ga0c966136905f467816307cfba6deb5fd}{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info} (struct \hyperlink{structlws__client__connect__info}{lws\+\_\+client\+\_\+connect\+\_\+info} $\ast$ccinfo)
\item 
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws $\ast$L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__client_ga4af0a20108a95e8b6d94dd4d80055ff3}{lws\+\_\+client\+\_\+connect} (struct lws\+\_\+context $\ast$clients, const char $\ast$address, int port, int ssl\+\_\+connection, const char $\ast$path, const char $\ast$host, const char $\ast$origin, const char $\ast$protocol, int ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one) L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED
\item 
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws $\ast$L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT \hyperlink{group__client_gac6a8558b4410961a880241c2ac1271e2}{lws\+\_\+client\+\_\+connect\+\_\+extended} (struct lws\+\_\+context $\ast$clients, const char $\ast$address, int port, int ssl\+\_\+connection, const char $\ast$path, const char $\ast$host, const char $\ast$origin, const char $\ast$protocol, int ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one, void $\ast$userdata) L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED
\item 
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int \hyperlink{group__client_ga4f44b8230e6732816ca5cd8d1aaaf340}{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl} (const struct \hyperlink{structlws__context__creation__info}{lws\+\_\+context\+\_\+creation\+\_\+info} $\ast$info, struct lws\+\_\+vhost $\ast$vhost)
\item 
L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int {\bfseries lws\+\_\+http\+\_\+client\+\_\+read} (struct lws $\ast$wsi, char $\ast$$\ast$buf, int $\ast$len)\hypertarget{group__client_ga4450c34200bf9dab3beb90ef23221870}{}\label{group__client_ga4450c34200bf9dab3beb90ef23221870}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{Client releated functions}

\subsection{Enumeration Type Documentation}
\index{Client@{Client}!lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags@{lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags}}
\index{lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags@{lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags}!Client@{Client}}
\subsubsection[{\texorpdfstring{lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags}{lws\_client\_connect\_ssl\_connection\_flags}}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags}}\hypertarget{group__client_ga96f3dbad54b2853969cfa933d66871ce}{}\label{group__client_ga96f3dbad54b2853969cfa933d66871ce}


{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}

enum lws\+\_\+client\+\_\+connect\+\_\+ssl\+\_\+connection\+\_\+flags -\/ flags that may be used with struct \hyperlink{structlws__client__connect__info}{lws\+\_\+client\+\_\+connect\+\_\+info} ssl\+\_\+connection member to control if and how S\+SL checks apply to the client connection being created 
\begin{DoxyCode}
1848                                              \{
1849         LCCSCF\_USE\_SSL                          = (1 << 0),
1850         LCCSCF\_ALLOW\_SELFSIGNED                 = (1 << 1),
1851         LCCSCF\_SKIP\_SERVER\_CERT\_HOSTNAME\_CHECK  = (1 << 2)
1852 \};
\end{DoxyCode}


\subsection{Function Documentation}
\index{Client@{Client}!lws\+\_\+client\+\_\+connect@{lws\+\_\+client\+\_\+connect}}
\index{lws\+\_\+client\+\_\+connect@{lws\+\_\+client\+\_\+connect}!Client@{Client}}
\subsubsection[{\texorpdfstring{lws\+\_\+client\+\_\+connect(struct lws\+\_\+context $\ast$clients, const char $\ast$address, int port, int ssl\+\_\+connection, const char $\ast$path, const char $\ast$host, const char $\ast$origin, const char $\ast$protocol, int ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one) L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED}{lws\_client\_connect(struct lws\_context *clients, const char *address, int port, int ssl\_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf\_version\_or\_minus\_one) LWS\_WARN\_DEPRECATED}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws$\ast$ L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+client\+\_\+connect (
\begin{DoxyParamCaption}
\item[{struct lws\+\_\+context $\ast$}]{clients, }
\item[{const char $\ast$}]{address, }
\item[{int}]{port, }
\item[{int}]{ssl\+\_\+connection, }
\item[{const char $\ast$}]{path, }
\item[{const char $\ast$}]{host, }
\item[{const char $\ast$}]{origin, }
\item[{const char $\ast$}]{protocol, }
\item[{int}]{ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one}
\end{DoxyParamCaption}
)}\hypertarget{group__client_ga4af0a20108a95e8b6d94dd4d80055ff3}{}\label{group__client_ga4af0a20108a95e8b6d94dd4d80055ff3}


{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}

\hyperlink{group__client_ga4af0a20108a95e8b6d94dd4d80055ff3}{lws\+\_\+client\+\_\+connect()} -\/ Connect to another websocket server \begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000002}{Deprecated}]D\+E\+P\+R\+E\+C\+A\+T\+ED use lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info \end{DoxyRefDesc}

\begin{DoxyParams}{Parameters}
{\em clients} & Websocket context \\
\hline
{\em address} & Remote server address, eg, \char`\"{}myserver.\+com\char`\"{} \\
\hline
{\em port} & Port to connect to on the remote server, eg, 80 \\
\hline
{\em ssl\+\_\+connection} & 0 = ws\+://, 1 = wss\+:// encrypted, 2 = wss\+:// allow self signed certs \\
\hline
{\em path} & Websocket path on server \\
\hline
{\em host} & Hostname on server \\
\hline
{\em origin} & Socket origin name \\
\hline
{\em protocol} & Comma-\/separated list of protocols being asked for from the server, or just one. The server will pick the one it likes best. If you don\textquotesingle{}t want to specify a protocol, which is legal, use N\+U\+LL here. \\
\hline
{\em ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one} & -\/1 to ask to connect using the default, latest protocol supported, or the specific protocol ordinal\\
\hline
\end{DoxyParams}
This function creates a connection to a remote server \index{Client@{Client}!lws\+\_\+client\+\_\+connect\+\_\+extended@{lws\+\_\+client\+\_\+connect\+\_\+extended}}
\index{lws\+\_\+client\+\_\+connect\+\_\+extended@{lws\+\_\+client\+\_\+connect\+\_\+extended}!Client@{Client}}
\subsubsection[{\texorpdfstring{lws\+\_\+client\+\_\+connect\+\_\+extended(struct lws\+\_\+context $\ast$clients, const char $\ast$address, int port, int ssl\+\_\+connection, const char $\ast$path, const char $\ast$host, const char $\ast$origin, const char $\ast$protocol, int ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one, void $\ast$userdata) L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+D\+E\+P\+R\+E\+C\+A\+T\+ED}{lws\_client\_connect\_extended(struct lws\_context *clients, const char *address, int port, int ssl\_connection, const char *path, const char *host, const char *origin, const char *protocol, int ietf\_version\_or\_minus\_one, void *userdata) LWS\_WARN\_DEPRECATED}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws$\ast$ L\+W\+S\+\_\+\+W\+A\+R\+N\+\_\+\+U\+N\+U\+S\+E\+D\+\_\+\+R\+E\+S\+U\+LT lws\+\_\+client\+\_\+connect\+\_\+extended (
\begin{DoxyParamCaption}
\item[{struct lws\+\_\+context $\ast$}]{clients, }
\item[{const char $\ast$}]{address, }
\item[{int}]{port, }
\item[{int}]{ssl\+\_\+connection, }
\item[{const char $\ast$}]{path, }
\item[{const char $\ast$}]{host, }
\item[{const char $\ast$}]{origin, }
\item[{const char $\ast$}]{protocol, }
\item[{int}]{ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one, }
\item[{void $\ast$}]{userdata}
\end{DoxyParamCaption}
)}\hypertarget{group__client_gac6a8558b4410961a880241c2ac1271e2}{}\label{group__client_gac6a8558b4410961a880241c2ac1271e2}


{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}

\hyperlink{group__client_gac6a8558b4410961a880241c2ac1271e2}{lws\+\_\+client\+\_\+connect\+\_\+extended()} -\/ Connect to another websocket server \begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000003}{Deprecated}]D\+E\+P\+R\+E\+C\+A\+T\+ED use lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info \end{DoxyRefDesc}

\begin{DoxyParams}{Parameters}
{\em clients} & Websocket context \\
\hline
{\em address} & Remote server address, eg, \char`\"{}myserver.\+com\char`\"{} \\
\hline
{\em port} & Port to connect to on the remote server, eg, 80 \\
\hline
{\em ssl\+\_\+connection} & 0 = ws\+://, 1 = wss\+:// encrypted, 2 = wss\+:// allow self signed certs \\
\hline
{\em path} & Websocket path on server \\
\hline
{\em host} & Hostname on server \\
\hline
{\em origin} & Socket origin name \\
\hline
{\em protocol} & Comma-\/separated list of protocols being asked for from the server, or just one. The server will pick the one it likes best. \\
\hline
{\em ietf\+\_\+version\+\_\+or\+\_\+minus\+\_\+one} & -\/1 to ask to connect using the default, latest protocol supported, or the specific protocol ordinal \\
\hline
{\em userdata} & Pre-\/allocated user data \begin{DoxyVerb} This function creates a connection to a remote server\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\index{Client@{Client}!lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info@{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info}}
\index{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info@{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info}!Client@{Client}}
\subsubsection[{\texorpdfstring{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info(struct lws\+\_\+client\+\_\+connect\+\_\+info $\ast$ccinfo)}{lws\_client\_connect\_via\_info(struct lws\_client\_connect\_info *ccinfo)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN struct lws$\ast$ lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info (
\begin{DoxyParamCaption}
\item[{struct {\bf lws\+\_\+client\+\_\+connect\+\_\+info} $\ast$}]{ccinfo}
\end{DoxyParamCaption}
)}\hypertarget{group__client_ga0c966136905f467816307cfba6deb5fd}{}\label{group__client_ga0c966136905f467816307cfba6deb5fd}


{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}

\hyperlink{group__client_ga0c966136905f467816307cfba6deb5fd}{lws\+\_\+client\+\_\+connect\+\_\+via\+\_\+info()} -\/ Connect to another websocket server 
\begin{DoxyParams}{Parameters}
{\em ccinfo} & pointer to \hyperlink{structlws__client__connect__info}{lws\+\_\+client\+\_\+connect\+\_\+info} struct \begin{DoxyVerb} This function creates a connection to a remote server using the
 information provided in ccinfo.\end{DoxyVerb}
 \\
\hline
\end{DoxyParams}
\index{Client@{Client}!lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl@{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl}}
\index{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl@{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl}!Client@{Client}}
\subsubsection[{\texorpdfstring{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl(const struct lws\+\_\+context\+\_\+creation\+\_\+info $\ast$info, struct lws\+\_\+vhost $\ast$vhost)}{lws\_init\_vhost\_client\_ssl(const struct lws\_context\_creation\_info *info, struct lws\_vhost *vhost)}}]{\setlength{\rightskip}{0pt plus 5cm}L\+W\+S\+\_\+\+V\+I\+S\+I\+B\+LE L\+W\+S\+\_\+\+E\+X\+T\+E\+RN int lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl (
\begin{DoxyParamCaption}
\item[{const struct {\bf lws\+\_\+context\+\_\+creation\+\_\+info} $\ast$}]{info, }
\item[{struct lws\+\_\+vhost $\ast$}]{vhost}
\end{DoxyParamCaption}
)}\hypertarget{group__client_ga4f44b8230e6732816ca5cd8d1aaaf340}{}\label{group__client_ga4f44b8230e6732816ca5cd8d1aaaf340}


{\ttfamily \#include $<$\hyperlink{libwebsockets_8h}{lib/libwebsockets.\+h}$>$}

\hyperlink{group__client_ga4f44b8230e6732816ca5cd8d1aaaf340}{lws\+\_\+init\+\_\+vhost\+\_\+client\+\_\+ssl()} -\/ also enable client S\+SL on an existing vhost


\begin{DoxyParams}{Parameters}
{\em info} & client ssl related info \\
\hline
{\em vhost} & which vhost to initialize client ssl operations on\\
\hline
\end{DoxyParams}
You only need to call this if you plan on using S\+SL client connections on the vhost. For non-\/\+S\+SL client connections, it\textquotesingle{}s not necessary to call this.

The following members of info are used during the call \begin{DoxyVerb}  - options must have LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT set,
      otherwise the call does nothing
  - provided_client_ssl_ctx must be NULL to get a generated client
      ssl context, otherwise you can pass a prepared one in by setting it
  - ssl_cipher_list may be NULL or set to the client valid cipher list
  - ssl_ca_filepath may be NULL or client cert filepath
  - ssl_cert_filepath may be NULL or client cert filepath
  - ssl_private_key_filepath may be NULL or client cert private key
\end{DoxyVerb}


You must create your vhost explicitly if you want to use this, so you have a pointer to the vhost. Create the context first with the option flag L\+W\+S\+\_\+\+S\+E\+R\+V\+E\+R\+\_\+\+O\+P\+T\+I\+O\+N\+\_\+\+E\+X\+P\+L\+I\+C\+I\+T\+\_\+\+V\+H\+O\+S\+TS and then call \hyperlink{group__context-and-vhost_ga0c54c667ccd9b8b3dddcd123ca72f87c}{lws\+\_\+create\+\_\+vhost()} with the same info struct. 