Commit 73ecc26c authored by Hebant Martin's avatar Hebant Martin
Browse files

Initial commit

parents
TYPE=exec# shared, static or exec
BUILD=debug# debug or release
EXEC=main
CXXFLAGS=-Wall -std=c++11 -DLINUX -DSSLSOCKET
CXXFLAGS_debug=-g
CXXFLAGS_release=-s -O2
LDFLAGS=-ldl -lpthread -L./mbedtls-2.2.1/library -lmbedtls -lmbedx509 -lmbedcrypto
LDFLAGS_debug=
LDFLAGS_release=
INCLUDES=-I./mbedtls-2.2.1/include
srcdir=.
hdir=.
objdir=.
bindir=.
CXX=g++
AR=ar
CXXFLAGS+= $(CXXFLAGS_$(BUILD)) -I$(hdir) $(INCLUDES)
ifeq ($(TYPE),shared)
CXXFLAGS+= -fPIC
endif
LDFLAGS+= $(LDFLAGS_$(BUILD))
SRC=$(wildcard $(srcdir)/*.cpp)
OBJ=$(addprefix $(objdir)/,$(notdir $(SRC:.cpp=.o)))
all: $(EXEC)
@echo "$(EXEC) built ($(TYPE) $(BUILD))"
$(EXEC): $(OBJ)
ifeq ($(TYPE),static)
@$(AR) -q $(bindir)/lib$@.a $^
endif
ifeq ($(TYPE),exec)
@$(CXX) -o $(bindir)/$@ $^ $(LDFLAGS)
endif
ifeq ($(TYPE),shared)
@$(CXX) -shared -fPIC -o $(bindir)/lib$@.so $^ $(LDFLAGS)
endif
#----DEPENDENCES----
#ex: main.o: hello.h
$(objdir)/%.o: $(srcdir)/%.cpp
@$(CXX) -c $(CXXFLAGS) -o $@ $<
.PHONY: clean mrproper
clean:
@rm -rf $(objdir)/*.o
mrproper: clean
@rm -rf $(bindir)/$(EXEC)
WebConsole is a simple light weight webserver for low power device.
This version works fine and allow to access file in the same derectory as the exceutable. And SSL support is almost complet.
This version use a thread per client (created at the connection) which is inefficient, so I start working on a ThreadPool and moved to an event based achitecture.
TYPE=exec# shared, static or exec
BUILD=debug# debug or release
EXEC=WebConsole
CXXFLAGS=-Wall -std=c++11 -DLINUX -DSSLSOCKET
CXXFLAGS_debug=-g
CXXFLAGS_release=-s -O2
LDFLAGS=-L../WebConsoleCore/bin -lWebConsoleCore
LDFLAGS_debug=
LDFLAGS_release=
INCLUDES=-I../WebConsoleCore/src -I../mbedtls-2.2.1/include
srcdir=./src
hdir=./src
objdir=./obj
bindir=./bin
CXX=g++
AR=ar
CXXFLAGS+= $(CXXFLAGS_$(BUILD)) -I$(hdir) $(INCLUDES)
ifeq ($(TYPE),shared)
CXXFLAGS+= -fPIC
endif
LDFLAGS+= $(LDFLAGS_$(BUILD))
SRC=$(wildcard $(srcdir)/*.cpp)
OBJ=$(addprefix $(objdir)/,$(notdir $(SRC:.cpp=.o)))
all: $(EXEC)
@echo "$(EXEC) built ($(TYPE) $(BUILD))"
$(EXEC): $(OBJ)
ifeq ($(TYPE),static)
@$(AR) -q $(bindir)/lib$@.a $^
endif
ifeq ($(TYPE),exec)
@$(CXX) -o $(bindir)/$@ $^ $(LDFLAGS)
endif
ifeq ($(TYPE),shared)
@$(CXX) -shared -fPIC -o $(bindir)/lib$@.so $^ $(LDFLAGS)
endif
#----DEPENDENCES----
#ex: main.o: hello.h
$(objdir)/%.o: $(srcdir)/%.cpp
@$(CXX) -c $(CXXFLAGS) -o $@ $<
.PHONY: clean mrproper
clean:
@rm -rf $(objdir)/*.o
mrproper: clean
@rm -rf $(bindir)/$(EXEC)
-----BEGIN CERTIFICATE-----
MIIFSDCCAzCgAwIBAgIBBDANBgkqhkiG9w0BAQsFADA9MRIwEAYDVQQDEwlsb2Nh
bGhvc3QxGjAYBgNVBAoTEU1hcnRpbiBIRUJBTlQhIENBMQswCQYDVQQGEwJGUjAe
Fw0xNjAxMDEwMDAwMDBaFw0yNjAxMDEwMDAwMDBaMD0xEjAQBgNVBAMTCWxvY2Fs
aG9zdDEaMBgGA1UEChMRTWFydGluIEhFQkFOVCEgQ0ExCzAJBgNVBAYTAkZSMIIC
IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAhRe8oiVe27P1roHnEl9E5ZRG
gDdj5+mxZa953a/M3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JsNu+OcUKH0vzgO0SF+UBXv
rpgtEpox4QXk2HppsLMRdUPLkwXKr1ynkhrmHpIkTjscNIQfn1Rcc5vjJXDUB7Y7
lT/wjl7EIEfMIU4MgqlxlexGKCv/QDrUP6kHYb+wzNbb/opShVspWmto1+6y/ymX
DXMrWyn1H0N3btDRQUZdK0R6nndKkEnHtn4BD15Zi7SunDJutMYu1ZhWExkt2/H2
gRIKGwbwOzjKwViUYYMDQMHkTcP4wPorgV7X3dZp1VyZsHFqpWWxnvInBsK/mJQJ
OIhgvjMrfH3hkULgg+6NTF4EAT219wUxH7NhqSGQMtvC3PapNMKR2tOyuhRYLALB
IdpebdQuidaEXi1UqH0DAwFvjMdJHqMEomkG3eNkj4NRAl8REo3U3J2T7o39kIrQ
pZw0CA05cDEdj0zt
-----END CERTIFICATE-----
html text/html
png image/png
jpg image/jpeg
jpeg image/jpeg
gif image/gif
css text/css
js text/javascript
pdf application/pdf
mp4 video/mp4
avi video/x-msvideo
txt text/plain
bin application/octet-stream
\ No newline at end of file
-----BEGIN RSA PRIVATE KEY-----
MIIJJwIBAAKCAgEAiKNbCI2vCE+d2jsh83wtjRi4Apb1KXbBqgUUArMZDiR5oc80
Jt6aAupiGJjJXxsSyiPfYU8CboFFsGkUR2OFTTlvKkspFjclU6xsp7MTcskuxgXS
CuaRf5SmBIZjf1Lsuv1WsJNZhhGJg7murYQkHNdWi3djs7yMc56PZV13dI9tBEpD
clSrSEgd8K//OYig5hq4FRmqbUppOaBEZ0/nULrjG3vTjVm5ovioNwCnbwggQB+F
9DFkUXyVhO7hiiYscWdCiHyBu8qITW0eY7jULsJQGAk89WkGO6WyRDenR2Gohoi+
WdbNp6I11jz8aWeb6NNSTb1UvCtMHL63X02is0hT1MWIYer3qojfnxU0YY4Uklx2
TlZYsw+QjSvVdmK5+/xBfi43onwgFYsxhrfuxt+viE7HHbyL8InH3Z9Fk63uNzC8
AQH/D2ELDnTdkp4OfAkaMdG4kuFI0+P/lDPpF+xlVrgfFbu44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</p>
C'est super :)
</body>
</html>
\ No newline at end of file
2016-02-17 15:09:23 WebConsole Dev (build 014)
2016-02-17 15:09:23 Server listening on port 443
#include "WebConsole.h"
using namespace std;
void onRequest80(Request& request, Response& response) {
if(Helper::defaultResource(request, response, ".") != 0)
response.send();
}
int main() {
WebConsole::init();
Socket::SSLConfig sslconfig;
sslconfig.LoadCrtFile("./serv2.crt");
sslconfig.Config(Socket::SERVER, Socket::TCP, "./privatekey.key");
WebConsole::server(443, onRequest80, &sslconfig);
WebConsole::end();
return 0;
}
\ No newline at end of file
TYPE=shared# shared, static or exec
BUILD=debug# debug or release
EXEC=WebConsoleCore
CXXFLAGS=-Wall -std=c++11 -DLINUX -DSSLSOCKET
CXXFLAGS_debug=-g
CXXFLAGS_release=-s -O2
LDFLAGS=-ldl -lpthread -L../mbedtls-2.2.1/library -lmbedtls -lmbedx509 -lmbedcrypto
LDFLAGS_debug=
LDFLAGS_release=
INCLUDES=-I../mbedtls-2.2.1/include
srcdir=./src
hdir=./src
objdir=./obj
bindir=./bin
CXX=g++
AR=ar
CXXFLAGS+= $(CXXFLAGS_$(BUILD)) -I$(hdir) $(INCLUDES)
ifeq ($(TYPE),shared)
CXXFLAGS+= -fPIC
endif
LDFLAGS+= $(LDFLAGS_$(BUILD))
SRC=$(wildcard $(srcdir)/*.cpp)
OBJ=$(addprefix $(objdir)/,$(notdir $(SRC:.cpp=.o)))
all: $(EXEC)
@echo "$(EXEC) built ($(TYPE) $(BUILD))"
$(EXEC): $(OBJ)
ifeq ($(TYPE),static)
@$(AR) -q $(bindir)/lib$@.a $^
endif
ifeq ($(TYPE),exec)
@$(CXX) -o $(bindir)/$@ $^ $(LDFLAGS)
endif
ifeq ($(TYPE),shared)
@$(CXX) -shared -fPIC -o $(bindir)/lib$@.so $^ $(LDFLAGS)
endif
#----DEPENDENCES----
#ex: main.o: hello.h
$(objdir)/%.o: $(srcdir)/%.cpp
@$(CXX) -c $(CXXFLAGS) -o $@ $<
.PHONY: clean mrproper
clean:
@rm -rf $(objdir)/*.o
mrproper: clean
@rm -rf $(bindir)/$(EXEC)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment