Skip to content

Commit

Permalink
Changed WebSockets library from libwebsock to libwebsockets
Browse files Browse the repository at this point in the history
  • Loading branch information
meetecho committed Mar 19, 2015
1 parent fb81d4a commit f500ae8
Show file tree
Hide file tree
Showing 7 changed files with 417 additions and 295 deletions.
36 changes: 12 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ To install it, you'll need to satisfy the following dependencies:
* [Sofia-SIP](http://sofia-sip.sourceforge.net/)
* [usrsctp](http://code.google.com/p/sctp-refimpl/) (only needed if you
are interested in Data Channels)
* [libwebsock](https://github.com/payden/libwebsock) (only needed if
* [libwebsockets](https://libwebsockets.org/) (only needed if
you are interested in WebSockets support)
* [libevent](http://libevent.org/) (only needed if you are interested in
WebSockets support, as libwebsock makes use of it)
* [cmake](http://www.cmake.org/) (only needed if you are interested in
WebSockets support, as libwebsockets makes use of it)
* [rabbitmq-c](https://github.com/alanxz/rabbitmq-c) (only needed if
you are interested in RabbitMQ support)

Expand Down Expand Up @@ -78,30 +78,18 @@ pretty easy and standard process:
* *Note:* you may need to pass --libdir=/usr/lib64 to the configure
script if you're installing on a x86_64 distribution.

The same applies for libwebsock, which is needed for the optional
The same applies for libwebsockets, which is needed for the optional
WebSockets support. If you're interested in supporting WebSockets to
control Janus, as an alternative (or replacement) to the default plain
HTTP REST API, you'll have to install the version ```1.0.4``` manually:

git clone git://github.com/payden/libwebsock.git
cd libwebsock
git checkout tags/v1.0.4
autoreconf -i
./autogen.sh
./configure --prefix=/usr && make && sudo make install
HTTP REST API, you'll have to install it manually:

git clone git://git.libwebsockets.org/libwebsockets
cd libwebsockets
mkdir build
cd build
cmake ..
make && sudo make install

* *Note:* you may need to pass --libdir=/usr/lib64 to the configure
script if you're installing on a x86_64 distribution.

* *Note:* as anticipated you'll need to install libevent-dev (or
libevent-devel) before installing libwebsock
([see here for more info](https://groups.google.com/forum/#!searchin/meetecho-janus/websockets/meetecho-janus/TqPNJDsUf2s/uBhlT8a4WUMJ)).

Please notice that you have to install version ```1.0.4``` and not any
later version. In fact, recent versions of libwebsock added support for
threading in the library, but it is currently experimental and doesn't
work as expected in Janus.

Finally, the same can be said for rabbitmq-c as well, which is needed
for the optional RabbitMQ support. In fact, several different versions
of the library can be found, and the versions usually available in most
Expand Down
10 changes: 5 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([Janus Gateway],[0.0.8],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com])
AC_INIT([Janus Gateway],[0.0.9],[https://github.com/meetecho/janus-gateway],[janus-gateway],[https://janus.conf.meetecho.com])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([foreign subdir-objects])
Expand Down Expand Up @@ -89,18 +89,18 @@ AC_CHECK_LIB([srtp],
[JANUS_MANUAL_LIBS+=" -lsrtp"],
[AC_MSG_ERROR([libsrtp not found.])])

AC_CHECK_LIB([websock],
[libwebsock_init],
AC_CHECK_LIB([websockets],
[libwebsocket_get_internal_extensions],
[
AS_IF([test "x$enable_websockets" = "xyes"],
[
AC_DEFINE(HAVE_WEBSOCKETS)
JANUS_MANUAL_LIBS+=" -lwebsock"
JANUS_MANUAL_LIBS+=" -lwebsockets"
])
],
[
AS_IF([test "x$enable_websockets" = "xyes"],
[AC_MSG_ERROR([libwebsocket not found. See README.md for installation instructions or use --disable-websockets])])
[AC_MSG_ERROR([libwebsockets not found. See README.md for installation instructions or use --disable-websockets])])
])
AM_CONDITIONAL([ENABLE_WEBSOCKETS], [test "x$enable_websockets" = "xyes"])

Expand Down
2 changes: 1 addition & 1 deletion docs/janus-doxygen.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = "Janus"
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 0.0.8
PROJECT_NUMBER = 0.0.9

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down
2 changes: 1 addition & 1 deletion html/janus.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ function Janus(gatewayCallbacks) {
Janus.log(server);
}
if(websockets) {
ws = new WebSocket(server);
ws = new WebSocket(server, 'janus-protocol');
ws.onerror = function() {
Janus.log("Error connecting to the Janus WebSockets server...");
if($.isArray(servers)) {
Expand Down
Loading

0 comments on commit f500ae8

Please sign in to comment.