[Libwebsockets] LWS_CALLBACK_HTTP send/write text only

Peter Kroon plakroon at gmail.com
Tue Apr 7 19:49:01 CEST 2015


Hi,

I'm trying to create a http server that will send some text to all requests.
I''ve used the code below. Only when I do Ctrl-C the webserver is shutdown
and the text will appear on the page in the webbrowser. Any hints on how I
can make this work properly?


case LWS_CALLBACK_HTTP: {
  char the_response[] = "Hello, World!";
  int strl = strlen(the_response);
  int n = libwebsocket_write(wsi, the_response, strl, LWS_WRITE_HTTP);
  printf("writing hello world ?....%d\n", n);
}


Thanks,
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20150407/1726a8ca/attachment.html>


More information about the Libwebsockets mailing list