mirror of https://github.com/adamdruppe/arsd.git
Merge pull request #304 from Panke/http2-mask-msgs
fix(http2): mask outgoing ws messages as client
This commit is contained in:
commit
d2d7cfc539
6
http2.d
6
http2.d
|
@ -3293,6 +3293,9 @@ class WebSocket {
|
||||||
private ushort port;
|
private ushort port;
|
||||||
private bool ssl;
|
private bool ssl;
|
||||||
|
|
||||||
|
// used to decide if we mask outgoing msgs
|
||||||
|
private bool isClient;
|
||||||
|
|
||||||
private MonoTime timeoutFromInactivity;
|
private MonoTime timeoutFromInactivity;
|
||||||
private MonoTime nextPing;
|
private MonoTime nextPing;
|
||||||
|
|
||||||
|
@ -3329,6 +3332,7 @@ class WebSocket {
|
||||||
+/
|
+/
|
||||||
/// Group: foundational
|
/// Group: foundational
|
||||||
void connect() {
|
void connect() {
|
||||||
|
this.isClient = true;
|
||||||
if(uri.unixSocketPath)
|
if(uri.unixSocketPath)
|
||||||
socket.connect(new UnixAddress(uri.unixSocketPath));
|
socket.connect(new UnixAddress(uri.unixSocketPath));
|
||||||
else
|
else
|
||||||
|
@ -3712,6 +3716,7 @@ class WebSocket {
|
||||||
void send(in char[] textData) {
|
void send(in char[] textData) {
|
||||||
WebSocketFrame wss;
|
WebSocketFrame wss;
|
||||||
wss.fin = true;
|
wss.fin = true;
|
||||||
|
wss.masked = this.isClient;
|
||||||
wss.opcode = WebSocketOpcode.text;
|
wss.opcode = WebSocketOpcode.text;
|
||||||
wss.data = cast(ubyte[]) textData;
|
wss.data = cast(ubyte[]) textData;
|
||||||
wss.send(&llsend);
|
wss.send(&llsend);
|
||||||
|
@ -3723,6 +3728,7 @@ class WebSocket {
|
||||||
/// Group: foundational
|
/// Group: foundational
|
||||||
void send(in ubyte[] binaryData) {
|
void send(in ubyte[] binaryData) {
|
||||||
WebSocketFrame wss;
|
WebSocketFrame wss;
|
||||||
|
wss.masked = this.isClient;
|
||||||
wss.fin = true;
|
wss.fin = true;
|
||||||
wss.opcode = WebSocketOpcode.binary;
|
wss.opcode = WebSocketOpcode.binary;
|
||||||
wss.data = cast(ubyte[]) binaryData;
|
wss.data = cast(ubyte[]) binaryData;
|
||||||
|
|
Loading…
Reference in New Issue