Skip to content

Commit 6537dea

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 1724307 + d783cc1 commit 6537dea

File tree

102 files changed

+14637
-708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+14637
-708
lines changed

ci/before_install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,15 @@ fi
4949
if [ "$TRAVIS_OS_NAME" = "linux" ] ;
5050
then
5151
travis_retry sudo apt-get update
52-
travis_retry sudo apt-get install git libglew-dev freeglut3 freeglut3-dev libgcrypt11-dev zlib1g-dev g++ libssl-dev nasm autoconf valgrind libyaml-dev lcov cmake gdb quilt
52+
travis_retry sudo apt-get install git libglew-dev freeglut3 freeglut3-dev libgcrypt11-dev zlib1g-dev g++ libssl-dev nasm autoconf valgrind libyaml-dev lcov cmake gdb quilt libuv-dev
5353
fi
5454

5555
if [ "$TRAVIS_OS_NAME" = "osx" ] ;
5656
then
5757
brew update;
5858
#brew upgrade cmake;
5959
brew install quilt
60+
brew install libuv
6061
sudo /usr/sbin/DevToolsSecurity --enable
6162
lldb --version
6263
lldb --help

examples/pxScene2d/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
> * From terminal install dependencies: cmake, pkg-config, quilt, java.
3838
3939
```bash
40-
brew install cmake pkg-config quilt caskroom/cask/java
40+
brew install cmake pkg-config quilt caskroom/cask/java libuv
4141
```
4242
4343
## Windows Setup

examples/pxScene2d/external/build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,19 @@ then
142142

143143
fi
144144

145+
#--------- uWebSockets
146+
if [ ! -e ./uWebSockets/libuWS.dylib ] ||
147+
[ "$(uname)" != "Darwin" ]
148+
then
149+
150+
cd uWebSockets
151+
mv Makefile.build Makefile
152+
make
153+
cd ..
154+
155+
fi
156+
#--------
157+
145158
# v8
146159
# todo - uncomment - for now build v8 with buildV8.sh directly
147160
#bash buildV8.sh
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uWebSockets-0.14.8
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
misc/* linguist-vendored
2+
*.h linguist-language=C++
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
osx_image: xcode7.3
2+
os:
3+
- osx
4+
script: brew install --force openssl libuv && make && make install && make tests && time ./testsBin
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Copyright (c) 2016 Alex Hultman and contributors
2+
3+
This software is provided 'as-is', without any express or implied
4+
warranty. In no event will the authors be held liable for any damages
5+
arising from the use of this software.
6+
7+
Permission is granted to anyone to use this software for any purpose,
8+
including commercial applications, and to alter it and redistribute it
9+
freely, subject to the following restrictions:
10+
11+
1. The origin of this software must not be misrepresented; you must not
12+
claim that you wrote the original software. If you use this software
13+
in a product, an acknowledgement in the product documentation would be
14+
appreciated but is not required.
15+
2. Altered source versions must be plainly marked as such, and must not be
16+
misrepresented as being the original software.
17+
3. This notice may not be removed or altered from any source distribution.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
CPP_SHARED := -std=c++11 -O3 -I src -shared -fPIC src/Extensions.cpp src/Group.cpp src/Networking.cpp src/Hub.cpp src/Node.cpp src/WebSocket.cpp src/HTTPSocket.cpp src/Socket.cpp src/Epoll.cpp
2+
CPP_OPENSSL_OSX := -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
3+
CPP_OSX := -stdlib=libc++ -mmacosx-version-min=10.7 -undefined dynamic_lookup $(CPP_OPENSSL_OSX)
4+
5+
DEFS = -DUSE_LIBUV
6+
CFLAGS += $(DEFS)
7+
8+
default:
9+
make `(uname -s)`
10+
Linux:
11+
$(CXX) $(CPPFLAGS) $(CFLAGS) $(CPP_SHARED) -s -o libuWS.so
12+
Darwin:
13+
$(CXX) $(CPPFLAGS) $(CFLAGS) $(CPP_SHARED) $(CPP_OSX) -o libuWS.dylib
14+
.PHONY: install
15+
install:
16+
make install`(uname -s)`
17+
.PHONY: installLinux
18+
installLinux:
19+
$(eval PREFIX ?= /usr)
20+
if [ -d "/usr/lib64" ]; then mkdir -p $(PREFIX)/lib64 && cp libuWS.so $(PREFIX)/lib64/; else mkdir -p $(PREFIX)/lib && cp libuWS.so $(PREFIX)/lib/; fi
21+
mkdir -p $(PREFIX)/include/uWS
22+
cp src/*.h $(PREFIX)/include/uWS/
23+
.PHONY: installDarwin
24+
installDarwin:
25+
$(eval PREFIX ?= /usr/local)
26+
mkdir -p $(PREFIX)/lib
27+
cp libuWS.dylib $(PREFIX)/lib/
28+
mkdir -p $(PREFIX)/include/uWS
29+
cp src/*.h $(PREFIX)/include/uWS/
30+
.PHONY: clean
31+
clean:
32+
rm -f libuWS.so
33+
rm -f libuWS.dylib
34+
.PHONY: tests
35+
tests:
36+
$(CXX) $(CPP_OPENSSL_OSX) -std=c++11 -O3 tests/main.cpp -Isrc -o testsBin -lpthread -L. -luWS -lssl -lcrypto -lz -luv
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<div align="center"><img src="misc/images/logo.png"/></div>
2+
3+
µWS ("[micro](https://en.wikipedia.org/wiki/Micro-)WS") is a WebSocket and HTTP implementation for clients and servers. Simple, efficient and lightweight.
4+
5+
[Wiki pages & user manual](https://github.com/uNetworking/uWebSockets/wiki/User-manual-v0.14.x)
6+
7+
#### Build optimized WebSocket & HTTP servers & clients in no time.
8+
```c++
9+
#include <uWS/uWS.h>
10+
using namespace uWS;
11+
12+
int main() {
13+
Hub h;
14+
std::string response = "Hello!";
15+
16+
h.onMessage([](WebSocket<SERVER> *ws, char *message, size_t length, OpCode opCode) {
17+
ws->send(message, length, opCode);
18+
});
19+
20+
h.onHttpRequest([&](HttpResponse *res, HttpRequest req, char *data, size_t length,
21+
size_t remainingBytes) {
22+
res->end(response.data(), response.length());
23+
});
24+
25+
if (h.listen(3000)) {
26+
h.run();
27+
}
28+
}
29+
```
30+
31+
#### Excel across the board.
32+
<div align="center"><img src="misc/images/overview.png"/></div>
33+
34+
#### Fast does not imply broken.
35+
Gracefully passes the [entire Autobahn fuzzing test suite](http://htmlpreview.github.io/?https://github.com/uNetworking/uWebSockets/blob/master/misc/autobahn/index.html) with no failures or Valgrind/ASAN errors. With or without SSL/permessage-deflate.
36+
37+
#### Freely available.
38+
An open source ([Zlib](LICENSE)) hobby project of [mine](https://github.com/alexhultman) since 2016. Sponsored by [BitMEX.com](https://bitmex.com) since 2018.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<ItemGroup>
3+
<ProjectConfiguration Include="Release|x64">
4+
<Configuration>Release</Configuration>
5+
<Platform>x64</Platform>
6+
</ProjectConfiguration>
7+
<ProjectConfiguration Include="Debug|x64">
8+
<Configuration>Debug</Configuration>
9+
<Platform>x64</Platform>
10+
</ProjectConfiguration>
11+
<ProjectConfiguration Include="Release|Win32">
12+
<Configuration>Release</Configuration>
13+
<Platform>Win32</Platform>
14+
</ProjectConfiguration>
15+
<ProjectConfiguration Include="Debug|Win32">
16+
<Configuration>Debug</Configuration>
17+
<Platform>Win32</Platform>
18+
</ProjectConfiguration>
19+
</ItemGroup>
20+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" />
21+
<PropertyGroup>
22+
<ConfigurationType>DynamicLibrary</ConfigurationType>
23+
<PlatformToolset>v140</PlatformToolset>
24+
<ProjectName>uWS</ProjectName>
25+
</PropertyGroup>
26+
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
27+
<ClCompile>
28+
<Optimization>MaxSpeed</Optimization>
29+
</ClCompile>
30+
</ItemDefinitionGroup>
31+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
32+
<ItemGroup>
33+
<ClCompile Include="src\Epoll.cpp" />
34+
<ClCompile Include="src\Extensions.cpp" />
35+
<ClCompile Include="src\Group.cpp" />
36+
<ClCompile Include="src\HTTPSocket.cpp" />
37+
<ClCompile Include="src\Hub.cpp" />
38+
<ClCompile Include="src\Networking.cpp" />
39+
<ClCompile Include="src\Node.cpp" />
40+
<ClCompile Include="src\Socket.cpp" />
41+
<ClCompile Include="src\WebSocket.cpp" />
42+
</ItemGroup>
43+
<ItemGroup>
44+
<ClInclude Include="src\Asio.h" />
45+
<ClInclude Include="src\Backend.h" />
46+
<ClInclude Include="src\Epoll.h" />
47+
<ClInclude Include="src\Extensions.h" />
48+
<ClInclude Include="src\Group.h" />
49+
<ClInclude Include="src\HTTPSocket.h" />
50+
<ClInclude Include="src\Hub.h" />
51+
<ClInclude Include="src\Libuv.h" />
52+
<ClInclude Include="src\Networking.h" />
53+
<ClInclude Include="src\Node.h" />
54+
<ClInclude Include="src\Socket.h" />
55+
<ClInclude Include="src\uWS.h" />
56+
<ClInclude Include="src\WebSocket.h" />
57+
<ClInclude Include="src\WebSocketProtocol.h" />
58+
</ItemGroup>
59+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" />
60+
</Project>

0 commit comments

Comments
 (0)