mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 05:26:15 +08:00
Merge pull request #1598 from cesanta/http-reverse-proxy
Added openSSL support
This commit is contained in:
commit
4f9cfdf65d
@ -1,11 +1,13 @@
|
||||
PROG ?= example
|
||||
CFLAGS ?= -DMG_IO_SIZE=128
|
||||
MBEDTLS_DIR ?=
|
||||
SSL = ?
|
||||
|
||||
ifeq "$(MBEDTLS_DIR)" ""
|
||||
else
|
||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -I$(MBEDTLS_DIR)/include -I/usr/include
|
||||
CFLAGS += -L$(MBEDTLS_DIR)/lib -lmbedtls -lmbedcrypto -lmbedx509
|
||||
ifeq "$(SSL)" "MBEDTLS"
|
||||
CFLAGS += -DMG_ENABLE_MBEDTLS=1 -lmbedtls -lmbedcrypto -lmbedx509
|
||||
endif
|
||||
|
||||
ifeq "$(SSL)" "OPENSSL"
|
||||
CFLAGS += -DMG_ENABLE_OPENSSL=1 -lssl -lcrypto
|
||||
endif
|
||||
|
||||
all: $(PROG)
|
||||
@ -13,7 +15,7 @@ all: $(PROG)
|
||||
|
||||
|
||||
$(PROG): main.c
|
||||
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) -o $(PROG) main.c
|
||||
$(CC) ../../mongoose.c -I../.. -W -Wall $(CFLAGS) $(EXTRA_CFLAGS) -o $(PROG) main.c
|
||||
|
||||
clean:
|
||||
rm -rf $(PROG) *.o *.dSYM *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb
|
||||
|
@ -5,10 +5,14 @@
|
||||
// 1. Run `make`. This builds and starts a proxy on port 8000
|
||||
// 2. Start your browser, go to https://localhost:8000
|
||||
//
|
||||
// To enable SSL/TLS, build it like this:
|
||||
// make MBEDTLS_DIR=/path/to/your/mbedtls/installation
|
||||
// To enable SSL/TLS, add SSL=OPENSSL or SSL=MBEDTLS
|
||||
|
||||
static const char *s_backend_url = "https://cesanta.com";
|
||||
static const char *s_backend_url =
|
||||
#if defined(MG_ENABLE_MBEDTLS) || defined(MG_ENABLE_OPENSSL)
|
||||
"https://cesanta.com";
|
||||
#else
|
||||
"http://info.cern.ch";
|
||||
#endif
|
||||
static const char *s_listen_url = "http://localhost:8000";
|
||||
|
||||
#include "mongoose.h"
|
||||
|
Loading…
Reference in New Issue
Block a user