Commit Graph

36 Commits

Author SHA1 Message Date
James Chen fc0ad058a5 fixed #17427: lws_parse_url has wrong behavior, it parses ’ws://domain.com/abc/d’ to ‘path: abc/d’ rather than ‘path: /adb/d’. (#17455)
* fixed #17427: lws_parse_url have wrong behavior, it parses ’ws://domain.com/abc/d’ to ‘path: abc/d’ rather than ‘path: /adb/d’.
Adds Uri class and parses Url to scheme, host, port, path in engine side.

* Moves Uri implementation to Uri.cpp, adds getter functions.

* Updates win32 project.

* Updates win10 project.

* Adds include header for atoi error on android.

* Updates tizen project configuration.
2017-03-07 13:35:59 +08:00
James Chen 619e012d9b [WebSocket] Adds support for getting url and server selected protocol (#17381)
* [WebSocket] Adds support for getting url and server selected protocol

* Adds const keyword for getter methods, and make LOGE also works in release mode.
2017-02-20 09:44:20 +08:00
CocosRobot d07794052f Update license to 2017 (#17362)
* Typo: CopyRight -> Copyright

* Copyright update: chukong-inc.com -> Chukong Technologies Inc.

* [js files] Copyright update: 2014 -> 2014-2017

* [cpp files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2015 -> 2015-2017

* [js files] Copyright update: 2014 -> 2014-2017

* Copyright update: 2016 -> 2016-2017

* Copyright update: 2013 -> 2013-2017

* Copyright update: 201?-201? -> 201?-2017

* License year fixes.

* Liscene year fix in CCRay.cpp

* Updates license years in CCGLProgramState.h & CCGLProgramStateCache.h
2017-02-14 14:36:57 +08:00
James Chen 4237639dd6 Some fixes for websocket (#17342)
* libwebsockets & curl are dynamic libraries now, modify project configuration for win32.
Updates WebSocketTest.cpp to test wss connection.

* Corrects some logic in WebSocket.cpp. Adds wss test case. WebSocketTest suggests developers to use `WebSocket::closeAsync` method which will not block current thread.

* mutex unlock fix in WebSocket.cpp. Reverts TEST URL.

* Allows self-assign cert.

* Each ws connection will create a virutal host now. Supports self-signed cert and update test case to suggest developer use ‘closeAsync’.

* Updates deps to 123.
2017-02-13 15:15:23 +08:00
James Chen b1f2a056b2 Refactor WebSocket to support SSL (wss) (#17172)
* Refactors WebSocket:
1. Supports wss protocol
2. Uses only one libwebsockets context, multiple wsi instances to avoid multi-thread issues
3. Uses lws_create_vhost to create multiple virtual host, different protocols works

* Adds openssl include path to xcode project configuration.

* mac doesn’t depend on curl

* ca file path should be full path.

* More bug fixes like which in https://github.com/cocos2d/cocos2d-x/pull/6986

* Remove curl dependence for mac

* Updates Andorid.mk

* [win32] Adds wss support for win32, and updates openssl, libcurl, libwebsockets libraries.

* Updates external/config.json to 118.

* [win32] Updates cocos/2d/libcocos2d.vcxproj to fix compilation error while building in release mode.

* Linux support websocket ssl connection.

* Updates external/config.json

* Updates install-deps-linux.sh

* Adds dependence of binutils, print ld version

* Updates travis scripts.

* Updates travis scripts.

* Updates travis script, don’t output log while extracting.

* update before-install.sh

* updates before-install.sh

* updates before-install.sh

* don’t output log for installing software.

* Updates config.json to 120.
2017-01-19 13:55:14 +08:00
James Chen b135d512d2 Update copyright to 2016. (#16311) 2016-08-05 09:42:15 +08:00
mogemimi 2df9afbe71 Fix typos in documentation and comments 2016-05-05 08:05:20 +09:00
James Chen 6dff5fdc13 std::shared_ptr<bool> -> std::shared_ptr<std::atomic<bool>>
The reference count field in shared_ptr is threadsafe but the value field is not. So we need to wrap a std::atomic for preventing potential thread racing.
2016-04-07 15:06:19 +08:00
James Chen 037051d9c4 Closes websocket connection by dispatching a 'resetDirector' event. 2016-02-29 18:55:51 +08:00
James Chen 28a3f78c65 Adds missing <mutex>, <memory> include files in WebSocket.h 2016-01-22 18:10:24 +08:00
James Chen b73b16d425 Adds isDestroy std::share_ptr variable to dectect whether websocket instance was destroyed. 2016-01-22 17:43:30 +08:00
James Chen a64a789308 _readyState must be set to State::CLOSED and _delegate->onClose(this) must be invoked at the end of WebSocket::close. 2016-01-22 15:20:43 +08:00
James Chen ed9ed6c92f Don't change the behavior of WebSocket::close method. WebSocket::close is an synchronous method before, adds a WebSocket::closeAsync method for asynchronous closing. 2016-01-22 14:22:33 +08:00
James Chen d122784ad4 Adds WebSocket::closeAllConnections() method. 2016-01-13 21:15:48 +08:00
James Chen f9e8ae0f09 WebSocket refactoring, bug fixes, improvements, and passes most Autobahn Test (The most standard WebSocket Protocol Test). 2016-01-13 21:14:38 +08:00
mogemimi 41dd44c75d Fix some typos in docs 2016-01-11 19:23:05 +09:00
mogemimi 9df30d2454 Fix typos in documentation 2015-10-23 16:59:51 +09:00
linshun 2a02510a9c issue #12078: Added network group. 2015-05-28 15:46:36 +08:00
samuele3hu bb225d052e Update comments of some header files 2015-03-27 15:27:08 +08:00
samuele3hu e0bde0f789 Update comments of some header files 2015-03-26 22:07:44 +08:00
samuele3hu 31b34ddf77 Update comments of some header files 2015-03-19 16:45:53 +08:00
Ricardo Quesada 6f3ca63f00 Moved base/CCPlatform* -> platform/CCPlatform* 2014-09-09 17:17:07 -07:00
Ricardo Quesada 9082ca18c3 Platform fixed 2014-09-09 16:50:02 -07:00
minggo 3679d66c8e remove unneeded includes 2014-08-29 15:39:52 +08:00
samuele3hu ada7fa23d3 Add CC_DLL for related network files 2014-08-22 13:42:46 +08:00
Ricardo Quesada 9b118e5e96 Squashed commit of the following:
commit 519fcd7f68e3586c376fd5e8d4a0ee220a48d225
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 10:10:06 2014 -0700

    Updates templates files

commit 2b07843ebe592f56b2abc544ccf66d441bb19fc5
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 10:08:19 2014 -0700

    compiles on Windows

commit b175522ef7205eaab3bd3f26c27c5d6514cbe2a4
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:55:30 2014 -0700

    adds cocos2d.h

commit 4c3d14f929bac017b93ca843b4f149d352264a30
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:54:24 2014 -0700

    re-adds missing files

commit f729181728959260d14c4152555534f5beec8e05
Merge: 148da79 2adac67
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:51:12 2014 -0700

    Merge branch 'includes_fixes' of github.com:ricardoquesada/cocos2d-x into includes_fixes

commit 148da79010c5dffeab885933624cffaf3d588852
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:49:12 2014 -0700

    Adds SimpleAudioEngine

commit 2adac67019180ec82b7bd03f0b67c12f62e29e77
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:47:45 2014 -0700

    Compiles for Android

commit 4a300d1b9225fa5708f25a69a50bb531f0ac1a32
Author: Ricardo Quesada <ricardoquesada@gmail.com>
Date:   Sat Apr 26 09:13:35 2014 -0700

    Fixes the includes
2014-04-26 10:11:22 -07:00
James Chen e075b82dfe tab -> 4 spaces, whitespace cleanup. 2014-03-24 17:58:35 +08:00
Dhilan007 d0e3a81d18 fix compiling error cause by undefined ssize_t on vs. 2014-01-21 09:52:43 +08:00
James Chen 9f793f8a9b Warning fixes: 1) getZOrder —> getLocalZOrder. 2) long —> int 2014-01-20 15:03:30 +08:00
James Chen f8d369248b closed #3605: Websocket doesn't support send/receive data which larger than 4096 bytes, renames member variables to follow cocos2d-x coding guide line. 2014-01-09 15:18:06 +08:00
edwardzhou 480a9277da fix WebSocket cannot send/receive more than 4096 bytes of data 2014-01-09 13:29:56 +08:00
walzer d4c1aa92d5 add copyrights for 2014, in folders other then 2d. 2014-01-07 11:47:11 +08:00
minggo 07600bd46b network -> cocos2d::network 2014-01-02 16:25:35 +08:00
minggo fa7c97171b fix some warnings 2013-12-06 16:32:06 +08:00
minggo 6fc2be62f5 issue #2905: testcpp bild ok on Android 2013-10-15 18:00:03 +08:00
minggo 4313c46e93 issue #2905:adjust folder structure 2013-10-12 11:22:05 +08:00