coTurn是一个开源的STUN和TURN及ICE服务项目,只是不支持Windows。
为了在window平台上使用coTurn源码,需要在windows平台下安装Cygwin环境,并编译coTurn源码,使其可以运行在windows平台上。
步骤:
1、安装Cygwin,地址:https://cygwin.com/install.html,按照其说明进行安装。参照说明地址:https://cygwin.com/cygwin-ug-net/cygwin-ug-net.html
安装过程中选择的镜像源地址,为了更加快速,使用http://mirrors.163.com/cygwin/
2、下载coTurn源码。目前Release最新版本的地址为:https://codeload.github.com/coturn/coturn/zip/4.5.0.4
3、编译:
XII. MS Windows and Cygwin support
Currently, this project cannot be compiled under MS Windows.
As the project is using fairly straightforward *NIX API, it is supported
under Cygwin environment in MS Windows.
One note for Cygwin users: we recommended libevent2 installation from the cygwin
"ports" site: http://sourceware.org/cygwinports/ . You will have to install
libevent2 runtime and libevent-devel packages. "Manual" libevent2 compilation
and installation in Cygwin is not recommended and does not garantee a good
outcome.
编译过程简单记录:
①生成Makefile文件
CC=gcc ./configure
1 Dev@Dev-PC /bin/coturn-4.5.0.4 2 $ CC=gcc ./configure 3 install 是 /usr/bin/install 4 pkill 是 /usr/bin/pkill 5 sqlite3 是 /usr/bin/sqlite3 6 Use TMP dir /var/tmp 7 Compiler: gcc 8 Library option -lsocket cannot be used 9 CYGWIN ? 10 Library option -lwldap64 cannot be used 11 Library option -lnsl cannot be used 12 Sockets code is fine: no sin_len field present 13 Ignore IP_RECVERR 14 Crypto SSL lib found. 15 SSL lib found. 16 Libevent2 development found. 17 Libevent2 runtime found. 18 Libevent2 runtime 'extra' found. 19 Libevent2 openssl found. 20 Libevent2 pthreads found. 21 SQLite library found. 22 SQLite development found. 23 PostgreSQL found. 24 MySQL found. 25 26 MONGODB DEVELOPMENT LIBRARIES (libmongoc-1.0 and libbson-1.0) AND/OR HEADER (mongoc.h) 27 ARE NOT INSTALLED PROPERLY ON THIS SYSTEM. 28 THAT'S OK BUT THE TURN SERVER IS BUILDING WITHOUT MONGODB SUPPORT. 29 30 31 HIREDIS DEVELOPMENT LIBRARY (libhiredis.*) AND/OR HEADERS (hiredis/*.h) 32 ARE NOT INSTALLED PROPERLY ON THIS SYSTEM. 33 THAT'S OK BUT THE TURN SERVER IS BUILDING WITHOUT REDIS SUPPORT. 34 35 PREFIX=/usr/local LOCALSTATEDIR=/usr/local/var OSLIBS= -L/usr/local/lib/ -L/usr/local/lib/ -lrt -lwldap32 -lintl -lresolv -lcrypto -lssl -levent_core -levent_extra -levent_openssl -levent_pthreads -lsqlite3 -Wl,-rpath,/usr/local/lib/ -Wl,-rpath,/usr/local/lib/ -Wl,-rpath,/usr/lib/postgresql -Wl,-rpath,/usr/lib/mysql -Wl,-rpath,/usr/local/lib DBLIBS= -lsqlite3 -L/usr/local/lib/ -L/usr/local/lib/ -lrt -lwldap32 -lintl -lresolv -lcrypto -lssl -levent_core -levent_extra -levent_openssl -levent_pthreads -lsqlite3 -L/usr/lib/postgresql -lpq -L/usr/local/lib/ -L/usr/local/lib/ -lrt -lwldap32 -lintl -lresolv -lcrypto -lssl -levent_core -levent_extra -levent_openssl -levent_pthreads -lsqlite3 -L/usr/lib/mysql -lmysqlclient OSCFLAGS=-g -Wall -Wno-deprecated-declarations -Wextra -Wformat-security -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -I/usr/local/include -I/usr/local/include/ -I/usr/local/include -DTURN_HAS_DAEMON -DINSTALL_PREFIX=/usr/local -DTURNDB=/usr/local/var/db/turndb DBCFLAGS= -I/usr/local/pgsql/include -I/usr/local/include/pgsql/ -I/usr/local/include/postgres/ -I/usr/local/postgres/include/ -I/usr/local/include/postgresql/ -I/usr/local/postgresql/include/ -I/usr/local/pgsql/include -I/usr/local/include/pgsql/ -I/usr/local/include/postgres/ -I/usr/local/postgres/include/ -I/usr/local/include/postgresql/ -I/usr/local/postgresql/include/ -I/usr/pgsql/include -I/usr/include/pgsql/ -I/usr/include/postgres/ -I/usr/postgres/include/ -I/usr/include/postgresql/ -I/usr/postgresql/include/ -I/usr/local/mysql/include -I/usr/local/include/mysql/ -I/usr/local/mysql/include -I/usr/local/include/mysql/ -I/usr/mysql/include -I/usr/include/mysql/ 36 Makefile created: success.