Stubplement WebSockets

This commit is contained in:
Přemysl Eric Janouch 2015-03-29 00:37:12 +01:00
parent b400ea8d09
commit b0c712c146
5 changed files with 1811 additions and 122 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "liberty"]
path = liberty
url = git://github.com/pjanouch/liberty.git
[submodule "http-parser"]
path = http-parser
url = https://github.com/joyent/http-parser.git

View File

@ -23,11 +23,14 @@ set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package (Curses)
find_package (PkgConfig REQUIRED)
pkg_check_modules (dependencies REQUIRED libcurl jansson)
pkg_check_modules (libssl REQUIRED libssl libcrypto)
find_package (LibEV REQUIRED)
pkg_check_modules (ncursesw ncursesw)
set (project_libraries ${dependencies_LIBRARIES} ${LIBEV_LIBRARIES} readline)
include_directories (${dependencies_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS})
set (project_libraries ${dependencies_LIBRARIES}
${libssl_LIBRARIES} ${LIBEV_LIBRARIES} readline)
include_directories (${dependencies_INCLUDE_DIRS}
${libssl_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS})
if (ncursesw_FOUND)
list (APPEND project_libraries ${ncursesw_LIBRARIES})
@ -44,7 +47,7 @@ configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h
include_directories (${PROJECT_BINARY_DIR})
# Build the main executable and link it
add_executable (${PROJECT_NAME} ${PROJECT_NAME}.c)
add_executable (${PROJECT_NAME} ${PROJECT_NAME}.c http-parser/http_parser.c)
target_link_libraries (${PROJECT_NAME} ${project_libraries})
# The files to be installed

20
README
View File

@ -6,17 +6,29 @@ json-rpc-shell
This software has been created as a replacement for the following shell, which
is written in Java: http://software.dzhuvinov.com/json-rpc-2.0-shell.html
Fuck Java. With a sharp, pointy object. In the ass. Hard. json-c as well.
Supported transports
--------------------
- HTTP
- HTTPS
- WebSocket
- WebSocket over TLS
WebSockets
----------
The WebSocket transport is rather experimental. As the JSON-RPC 2.0 spec
doesn't say almost anything about the underlying transports, I'll shortly
describe the way it's implemented: every request is sent as a single text
message. If it has an "id" field, i.e. it's not just a notification, the
client waits for a message from the server in response.
There's no support so far for any protocol extensions, nor for specifying
the higher-level protocol (the "Sec-Ws-Protocol" HTTP field).
Building and Running
--------------------
Build dependencies: CMake, pkg-config, help2man, liberty (included)
Runtime dependencies: libev, Jansson, cURL, readline
Build dependencies: CMake, pkg-config, help2man,
liberty (included), http-parser (included)
Runtime dependencies: libev, Jansson, cURL, readline, openssl
$ git clone https://github.com/pjanouch/json-rpc-shell.git
$ git submodule init

1
http-parser Submodule

@ -0,0 +1 @@
Subproject commit 5d414fcb4b2ccc1ce9d6063292f9c63c9ec67b04

File diff suppressed because it is too large Load Diff