new file mode 100644
@@ -0,0 +1,33 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=owsd
+PKG_RELEASE:=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL=http://public.inteno.se/owsd.git
+PKG_SOURCE_DATE:=2017-02-17
+PKG_SOURCE_VERSION:=8f62b44c37861dcacb201bbb79fa27d83ada4b48
+CMAKE_INSTALL:=1
+
+PKG_LICENSE:=GPL-2.0
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/owsd
+ SECTION:=base
+ CATEGORY:=Base system
+ TITLE:=OpenWrt WebSocket Daemon
+ DEPENDS:=+libwebsockets +libubox +libubus +libblobmsg-json +libopenssl
+endef
+
+define Package/owsd/install
+ $(INSTALL_DIR) $(1)/bin
+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/owsd $(1)/bin/
+ $(INSTALL_DIR) $(1)/etc/config
+ $(INSTALL_DATA) ./files/owsd.config $(1)/etc/config/owsd
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/owsd.init $(1)/etc/init.d/owsd
+endef
+
+$(eval $(call BuildPackage,owsd))
new file mode 100644
@@ -0,0 +1,7 @@
+config global global
+ option enabled 0
+
+config port
+ option port 80
+ list origin http://127.0.0.1
+ list origin http://192.168.1.1
new file mode 100644
@@ -0,0 +1,38 @@
+#!/bin/sh /etc/rc.common
+
+START=95
+STOP=10
+
+USE_PROCD=1
+PROG=/bin/owsd
+
+handle_port() {
+ local config="$1"
+ local __resultvar="$2"
+ local _args=""
+ local port interface origin
+
+ config_get port $config port
+ [ -n "$port" ] && _args="$_args -p $port"
+ config_get interface $config interface
+ [ -n "$interface" ] && _args="$_args -i $interface"
+ config_get origin $config origin
+ [ -n "$origin" ] && _args="$_args -o ${origin/ / -o }"
+
+ args="$args$_args"
+}
+
+start_service() {
+ local enabled
+
+ config_load owsd
+
+ config_get_bool enabled global enabled 0
+ [ $enabled -eq 0 ] && return
+
+ config_foreach handle_port port
+
+ procd_open_instance
+ procd_set_param command "$PROG" $args
+ procd_close_instance
+}