1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00
Commit graph

77 commits

Author SHA1 Message Date
Andy Green
677d6c1516 lwsws cleanup and allocate config strings dynamically
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 10:42:19 +08:00
Andy Green
f530de84ac lwsws remove non libuv SIGINT handler
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 10:31:16 +08:00
Andy Green
5afc56770d lejp bring into lws
lejp is already in lws as part of lwsws.  However it's too generally useful
to just put directly in lwsws, it will lead to multiple copies of the source
in differet subprojects.

This moves it directly into lws, lwsws now gets it from there.

Like lwsws, by default at cmake it is disabled.  Selecting LWS_WITH_LWSWS now
selects LWS_WITH_LEJP and you can set that at cmake individually as well.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-10 09:47:10 +08:00
Andy Green
b24aaeb822 add protocol plugin for post demo
Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-09 10:05:43 +08:00
Andy Green
cae57ad98d plugins_dir convert to array
If OOT lws plugins will be packaged as separate projects,
they're going to want to install their plugins somewhere
that makes sense for the package instead of one big lws
plugin dir.

This patch changes info to have a const char ** to a NULL
terminated array of directories it should search for
plugins.  lwsws knows about this and you can add to the
dir array using config fragments like

{
  "global": {
   "plugin-dir": "/usr/local/share/coherent-timeline/plugins"
  }
}

if the config fragment in /etc/lwsws/conf.d/ is also managed by the
package with the plugin, it can very cleanly add and remove itself
from lwsws based on package install status.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-02 10:03:25 +08:00
Andy Green
4664f71ed3 create_vhost move mounts list to info
There's no reason to not have the mounts linked list init also in the info
struct, rather than provide as a paramater to lws_create_vhost().  Now
is a good time to normalize that since this api only exists in master.

This also allows oldstyle "do everything at context creation time in one
vhost" guys to leverage mounts.

Also there's no reason the mounts linked-list pointer and all uses in lws
are non-const, so make them all explicitly const *.

Update the info struct docs to clarify which members are used when creating
a vhost and which for context creation.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-05-02 04:59:54 +08:00
Andy Green
734f10a19b logs document logrotate configuration for lwsws
After discussion here

https://libwebsockets.org/pipermail/libwebsockets/2016-April/002304.html

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-26 19:07:17 +08:00
Andy Green
f79534e0a4 post example in test server
https://github.com/warmcat/libwebsockets/issues/501

This demonstrates how to do a 303 redirect on POST and provide
the results there, in both libwebsockets-test-server and the
plugin version.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-25 10:04:49 +08:00
Andy Green
09490aeb93 coverity 160167 resource_path set at cmake may overflow buffer
resource_path is configured at cmake time (it's like /usr/share/libwebsockets-test-server)
it's true if you gave a >255 char path there it would blow up.

It's fixed but again not network-accessible.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-23 08:16:17 +08:00
Andy Green
42e8b189dc http cache policy
This allows mounts to define the caching policy of the files inside them.

Support is added in lwsws for controlling it from the config files.

The api for serializing a mount struct opaquely is removed and lws_http_mount struct
made public... it was getting out of control trying to hide the options.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-22 08:53:49 +08:00
Andy Green
c673125ce0 client http
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-18 20:05:43 +08:00
Andy Green
b21c20b5ff context settable server string
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-15 13:58:24 +08:00
Andy Green
2f0bc93d46 lws access log option and lwsws conf
This adds the ability to store apache-compatible logs to a file given at
vhost-creation time.

lwsws conf can set it per-vhost using "access-log": "<filepath>"

The feature defaults to disabled at cmake, it can be set independently but
LWS_WITH_LWSWS set it on.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-15 13:58:24 +08:00
Andy Green
57f2007105 vhost collect rx tx stats
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-15 13:57:20 +08:00
Andy Green
868b9f2ecb strict transport security vhost option flag and lwsws conf support
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-14 21:27:38 +08:00
Andy Green
a1ab201436 lwsws conf unix sockets support vhost conf option
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-14 21:27:38 +08:00
Andy Green
1042b34127 lwsws conf move interface to be vhost attribute
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-14 21:27:38 +08:00
Andy Green
b46e4a866d vhost keepalive timeout
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-14 20:59:16 +08:00
Andy Green
f5efa74cb7 cgi post
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
22d6f39e7f http2 update integration
https://github.com/warmcat/libwebsockets/issues/489

This

1) fixes the vhost changes on master

2) works around the ah pool changes

3) fixes some other build problems that appeared

4) hacks out physical flow control for internal streams

5) updates the advertised protocol to h2 needed by, eg, chrome 51

That gets it able to serve small (<4K, ie, one packet) files over http2

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
a5e73a1a4b lwsws cgi integration
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
6e7b79b263 lwsws specifically signed char return lejp
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
0a183545b2 lwsws conf and plugins convert to libuv apis
After discussion here

https://libwebsockets.org/pipermail/libwebsockets/2016-April/002268.html

scandir usage in

 - lwsws conf.c
 - lws plugin support

and

 - lws plugin apis for dl

are converted to us libuv apis so they can work cross-platform easily.

lws itself remains not requiring libuv, although it's an option.

 - LWS_WITH_LWSWS
 - LWS_WITH_PLUGINS

now force LWS_WITH_LIBUV if selected... both of these are new features
only in master atm and both are off by default in CMake.

There's a complication libuv can be too old to offer the necessary apis,
this is the case in Travis Trusty instance.  In that case, UV_VERSION_MAJOR ==0,
then the unix-only plugin implementation is used instead.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-13 11:53:40 +08:00
Andy Green
d459a6fadc lwsws redirect and correct vhost selection before accept
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-08 18:38:06 +08:00
Andy Green
37098ae2a2 lwsws protocol filter and options
Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-08 16:13:14 +08:00
Andy Green
020770566e plugins
This adds support for dynamically loaded plugins at runtime, which
can expose their own protocols or extensions transparently.

With these changes lwsws defaults to OFF in cmake, and if enabled it
automatically enables plugins and libuv support.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-04-07 09:38:08 +08:00
Andy Green
cd0c696a0d lwsws Libwebsockets Web Server
This makes a start on the LibWebSockets WebServer.

The app cmake build support and JSON config parsing are implemented and
the app can start, create the vhosts, listen and serve file:// mounts on
them.

Signed-off-by: Andy Green <andy@warmcat.com>
2016-03-28 10:49:57 +08:00