Updates from BitShares FC #22

Closed
nathanielhourt wants to merge 693 commits from dapp-support into latest-fc
3 changed files with 6 additions and 9 deletions
Showing only changes of commit 9c506d050b - Show all commits

View file

@ -65,7 +65,7 @@ BOOST_AUTO_TEST_CASE(login_test) {
try {
fc::api<calculator> calc_api( std::make_shared<some_calculator>() );
auto server = std::make_shared<fc::http::websocket_server>();
auto server = std::make_shared<fc::http::websocket_server>("");
server->on_connection([&]( const websocket_connection_ptr& c ){
auto wsc = std::make_shared<websocket_api_connection>(c, MAX_DEPTH);
auto login = std::make_shared<login_api>();
@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(optionals_test) {
BOOST_CHECK_EQUAL(oapi->foo("a", "b", "c"), "[\"a\",\"b\",\"c\"]");
BOOST_CHECK_EQUAL(oapi->foo("a", {}, "c"), "[\"a\",null,\"c\"]");
auto server = std::make_shared<fc::http::websocket_server>();
auto server = std::make_shared<fc::http::websocket_server>("");
server->on_connection([&]( const websocket_connection_ptr& c ){
auto wsc = std::make_shared<websocket_api_connection>(c, MAX_DEPTH);
wsc->register_api(fc::api<optionals_api>(optionals));

View file

@ -19,10 +19,9 @@ BOOST_AUTO_TEST_CASE(websocket_test)
fc::http::websocket_connection_ptr s_conn, c_conn;
int port;
{
fc::http::websocket_server server;
// even with this set, if the remote does not provide it, it will revert to
// even with this key set, if the remote does not provide it, it will revert to
// the remote endpoint
server.set_forward_header_key("MyProxyHeaderKey");
fc::http::websocket_server server("MyProxyHeaderKey");
server.on_connection([&]( const fc::http::websocket_connection_ptr& c ){
s_conn = c;
c->on_message_handler([&](const std::string& s){
@ -80,8 +79,7 @@ BOOST_AUTO_TEST_CASE(websocket_test_with_proxy_header)
int port;
{
// the server will be on the lookout for the key in the header
fc::http::websocket_server server;
server.set_forward_header_key("MyProxyHeaderKey");
fc::http::websocket_server server("MyProxyHeaderKey");
server.on_connection([&]( const fc::http::websocket_connection_ptr& c ){
s_conn = c;
c->on_message_handler([&](const std::string& s){

View file

@ -13,8 +13,7 @@ int main(int argc, char** argv)
fc::logger l = fc::logger::get("rpc");
l.add_appender( ca );
fc::http::websocket_server server;
server.set_forward_header_key("MyForwardHeaderKey");
fc::http::websocket_server server("MyForwardHeaderKey");
server.on_connection([&]( const fc::http::websocket_connection_ptr& c ){
c->on_message_handler([&](const std::string& s){