Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3302 commits
Select commit Hold shift + click to select a range
d9a54e1
[Modify] 2025
sta Mar 2, 2025
317bd43
[Modify] Add it
sta Mar 3, 2025
1c858cf
[Modify] Polish it
sta Mar 4, 2025
a8b1db0
[Modify] Polish it
sta Mar 5, 2025
555ab68
[Modify] Polish it
sta Mar 6, 2025
2b191f4
[Modify] Polish it
sta Mar 7, 2025
383daa6
[Modify] Rename it
sta Mar 8, 2025
7f6367b
[Modify] Polish it
sta Mar 9, 2025
b9e4f7b
[Modify] 2025
sta Mar 10, 2025
0030e5d
[Modify] Add it
sta Mar 11, 2025
e7e0f89
[Modify] Add the NoDelay property
sta Mar 12, 2025
1968368
[Modify] Add it
sta Mar 13, 2025
8a54736
[Modify] Replace it
sta Mar 14, 2025
fe316dc
[Modify] Replace it
sta Mar 15, 2025
132e378
[Modify] Replace it
sta Mar 16, 2025
939faa2
[Modify] Polish it
sta Mar 17, 2025
0fcb570
[Modify] Polish it
sta Mar 18, 2025
ca6c75a
[Modify] Add the NoDelay property
sta Mar 19, 2025
8c80be5
[Modify] Add it
sta Mar 20, 2025
1b58fcd
[Modify] Add it
sta Mar 21, 2025
3e0ddb6
[Modify] Add it
sta Mar 22, 2025
b4b1099
[Modify] Polish it
sta Mar 23, 2025
9b1974e
[Modify] Edit it
sta Mar 23, 2025
607835d
[Modify] Polish it
sta Mar 24, 2025
34486fa
[Modify] Throw an exception
sta Mar 24, 2025
2d3f5ff
[Modify] Polish it
sta Mar 25, 2025
689f9b7
[Modify] Throw an exception
sta Mar 25, 2025
45458f6
[Modify] Polish it
sta Mar 25, 2025
bf6fa13
[Modify] Polish it
sta Mar 26, 2025
bbc2c72
[Modify] Edit it
sta Mar 27, 2025
bd13ca3
[Modify] Polish it
sta Mar 27, 2025
8ee8c19
[Modify] Edit it
sta Mar 27, 2025
4f5f6fb
[Modify] Polish it
sta Mar 28, 2025
a807fa6
[Modify] Edit it
sta Mar 28, 2025
2fe3885
[Modify] Polish it
sta Mar 29, 2025
341c710
[Modify] Edit it
sta Mar 29, 2025
556e6da
[Modify] Polish it
sta Mar 30, 2025
563ca02
Revert "[Modify] Polish it"
sta Mar 30, 2025
2dc9317
[Modify] Polish it
sta Mar 30, 2025
8531404
[Modify] Edit it
sta Mar 30, 2025
9c19583
[Modify] Polish it
sta Mar 31, 2025
1a66843
[Modify] Edit it
sta Mar 31, 2025
9696770
[Modify] Polish it
sta Apr 1, 2025
3953314
[Modify] Edit it
sta Apr 1, 2025
fc11bad
[Modify] Polish it
sta Apr 2, 2025
ee17207
[Modify] Edit it
sta Apr 2, 2025
38ffe9b
[Modify] Throw an exception
sta Apr 3, 2025
c02875e
[Modify] Edit it
sta Apr 4, 2025
b972bcb
[Modify] Throw an exception
sta Apr 4, 2025
16fc3ec
[Modify] Throw an exception
sta Apr 5, 2025
e7a4bbb
[Modify] Polish it
sta Apr 6, 2025
2d493f3
[Modify] Edit it
sta Apr 6, 2025
3b44a32
[Modify] Edit it
sta Apr 6, 2025
b40bad1
[Modify] Polish it
sta Apr 7, 2025
9ce8e9b
[Modify] Edit it
sta Apr 7, 2025
f9c1d61
[Modify] Polish it
sta Apr 8, 2025
56fe390
[Modify] Edit it
sta Apr 8, 2025
d11e8a8
[Modify] Polish it
sta Apr 9, 2025
724629c
[Modify] Edit it
sta Apr 9, 2025
d6a463c
[Modify] Polish it
sta Apr 10, 2025
3d5e550
[Modify] Edit it
sta Apr 10, 2025
9bf2c89
[Modify] Polish it
sta Apr 11, 2025
a4d3599
[Modify] Edit it
sta Apr 11, 2025
cb7c232
[Modify] Polish it
sta Apr 11, 2025
35b7be4
[Modify] Polish it
sta Apr 12, 2025
5e7f403
[Modify] Edit it
sta Apr 12, 2025
c38bafc
[Modify] Polish it
sta Apr 13, 2025
1358144
[Modify] Edit it
sta Apr 13, 2025
b68723a
[Modify] Polish it
sta Apr 13, 2025
9b13f73
[Modify] Edit it
sta Apr 13, 2025
3c6cff1
[Modify] Polish it
sta Apr 14, 2025
f7e4d48
[Modify] Edit it
sta Apr 14, 2025
570bd02
[Modify] Edit it
sta Apr 15, 2025
038e52d
[Modify] Edit it
sta Apr 15, 2025
09694d0
[Modify] Edit it
sta Apr 15, 2025
a3ca7eb
[Modify] Polish it
sta Apr 15, 2025
9de8a04
[Modify] Edit it
sta Apr 15, 2025
8f81a4d
[Modify] Polish it
sta Apr 16, 2025
6a02688
[Modify] Edit it
sta Apr 16, 2025
a4707fd
[Modify] Polish it
sta Apr 17, 2025
b8c6e48
[Modify] Edit it
sta Apr 17, 2025
3392adf
[Modify] Polish it
sta Apr 18, 2025
adb8b45
[Modify] Edit it
sta Apr 18, 2025
46f79cc
[Modify] Polish it
sta Apr 19, 2025
d92f66b
[Modify] Edit it
sta Apr 19, 2025
15f4279
[Modify] Polish it
sta Apr 20, 2025
47e7293
[Modify] Edit it
sta Apr 20, 2025
9a68fdd
[Modify] Edit it
sta Apr 21, 2025
46f7edc
[Modify] Edit it
sta Apr 21, 2025
0ce7189
[Modify] Edit it
sta Apr 21, 2025
7343a62
[Modify] Polish it
sta Apr 22, 2025
122d1a2
[Modify] Polish it
sta Apr 23, 2025
4978ebc
[Modify] Polish it
sta Apr 23, 2025
eb1ad9e
[Modify] Polish it
sta Apr 24, 2025
a2a8d48
[Modify] Polish it
sta Apr 24, 2025
eaa3d9a
[Modify] Polish it
sta Apr 25, 2025
5bd4191
[Modify] Polish it
sta Apr 25, 2025
2962787
[Modify] Polish it
sta Apr 26, 2025
ab59790
[Modify] Polish it
sta Apr 27, 2025
da2c1aa
[Modify] Edit it
sta Apr 27, 2025
231e9f3
[Modify] Polish it
sta Apr 27, 2025
9a1cae9
[Modify] Polish it
sta Apr 28, 2025
edaaadc
[Modify] Polish it
sta Apr 28, 2025
0a67662
[Modify] Polish it
sta Apr 29, 2025
69797cb
[Modify] Polish it
sta Apr 30, 2025
b7a1b35
[Modify] Polish it
sta May 1, 2025
7c4c2bd
[Modify] Edit it
sta May 2, 2025
6203782
[Modify] Polish it
sta May 2, 2025
8412a1e
[Modify] Polish it
sta May 3, 2025
2d746ab
[Modify] Polish it
sta May 4, 2025
c204b82
[Modify] Throw an exception
sta May 5, 2025
8469533
[Modify] Throw an exception
sta May 6, 2025
5670918
[Modify] Edit it
sta May 6, 2025
a8faebf
[Modify] Polish it
sta May 7, 2025
34199b5
[Modify] Throw an exception
sta May 8, 2025
b85e781
[Modify] Throw an exception
sta May 9, 2025
aa0302c
[Modify] Throw an exception
sta May 10, 2025
6e494c2
[Modify] Edit it
sta May 11, 2025
633e6ef
[Modify] Polish it
sta May 12, 2025
34f9ba1
[Modify] Throw an exception
sta May 13, 2025
8f9b5bc
[Modify] Do not throw it
sta May 14, 2025
b54937e
[Modify] Throw an exception
sta May 15, 2025
b26c4e9
[Modify] Polish it
sta May 16, 2025
a1c685d
[Modify] Throw an exception
sta May 17, 2025
5bcde41
[Modify] Polish it
sta May 18, 2025
8ecf258
[Modify] Polish it
sta May 19, 2025
6d90d14
[Modify] Throw an exception
sta May 20, 2025
319fe53
[Modify] Throw an exception
sta May 21, 2025
e9e0d15
[Modify] Edit it
sta May 22, 2025
f7eb337
[Modify] Edit it
sta May 23, 2025
3daf3f7
[Modify] Polish it
sta May 24, 2025
398adfc
[Modify] Edit it
sta May 25, 2025
3c2058e
[Modify] Polish it
sta May 26, 2025
b6795cf
[Modify] Edit it
sta May 27, 2025
ce0f9d3
[Modify] Edit it
sta May 27, 2025
4860b98
[Modify] Polish it
sta May 28, 2025
f1420dd
[Modify] Edit it
sta May 28, 2025
f40537a
[Modify] Polish it
sta May 29, 2025
19ab6b9
[Modify] Edit it
sta May 29, 2025
0fd70b9
[Modify] Edit it
sta May 30, 2025
7f3ac9e
[Modify] Polish it
sta May 31, 2025
aa2da78
[Modify] Edit it
sta May 31, 2025
8f3e421
[Modify] Edit it
sta May 31, 2025
98ce305
[Modify] Polish it
sta Jun 1, 2025
23dae9d
[Modify] Edit it
sta Jun 1, 2025
6eae789
[Modify] Edit it
sta Jun 1, 2025
7818022
[Modify] Polish it
sta Jun 2, 2025
01de7fc
[Modify] Edit it
sta Jun 2, 2025
c55be60
[Modify] Edit it
sta Jun 2, 2025
8f63712
[Modify] Polish it
sta Jun 3, 2025
0983c04
[Modify] Edit it
sta Jun 3, 2025
da445c8
[Modify] Edit it
sta Jun 3, 2025
8b3115e
[Modify] Polish it
sta Jun 4, 2025
9d13553
[Modify] Edit it
sta Jun 4, 2025
b68b4b1
[Modify] Edit it
sta Jun 4, 2025
ebd7a97
[Modify] Edit it
sta Jun 5, 2025
aaa6293
[Modify] Edit it
sta Jun 5, 2025
49dda16
[Modify] Polish it
sta Jun 6, 2025
07dc675
[Modify] Edit it
sta Jun 6, 2025
90c3277
[Modify] Edit it
sta Jun 6, 2025
8043c17
[Modify] Edit it
sta Jun 7, 2025
3f44645
[Modify] Polish it
sta Jun 8, 2025
90dbff9
[Modify] Edit it
sta Jun 8, 2025
dcea409
[Modify] Edit it
sta Jun 8, 2025
bb27410
[Modify] Edit it
sta Jun 9, 2025
1165bf2
[Modify] Polish it
sta Jun 10, 2025
3213df7
[Modify] Edit it
sta Jun 10, 2025
5b577d9
[Modify] Edit it
sta Jun 10, 2025
0762d05
[Modify] Edit it
sta Jun 11, 2025
0cbf195
[Modify] Polish it
sta Jun 12, 2025
5b51052
[Modify] Polish it
sta Jun 13, 2025
0041070
[Modify] Polish it
sta Jun 14, 2025
1cfead4
[Modify] Polish it
sta Jun 15, 2025
6ac1bf3
[Modify] Polish it
sta Jun 16, 2025
51ae1bc
[Modify] Polish it
sta Jun 17, 2025
b7903b6
[Modify] Polish it
sta Jun 18, 2025
28e1d49
[Modify] Polish it
sta Jun 19, 2025
79663e3
[Modify] Polish it
sta Jun 20, 2025
a304b6c
[Modify] Polish it
sta Jun 21, 2025
0183e05
[Modify] Polish it
sta Jun 22, 2025
55fdfb8
[Modify] Polish it
sta Jun 23, 2025
86dee99
[Modify] Polish it
sta Jun 24, 2025
907af94
[Modify] Polish it
sta Jun 25, 2025
467a6e1
[Modify] Polish it
sta Jun 26, 2025
231ba90
[Modify] Polish it
sta Jun 27, 2025
855f028
[Modify] Polish it
sta Jun 28, 2025
34bcfd7
[Modify] Polish it
sta Jun 29, 2025
2d90062
[Modify] Polish it
sta Jun 30, 2025
c04c0db
[Modify] Add it
sta Jul 1, 2025
8f39190
[Modify] It is restricted
sta Jul 2, 2025
e28c6e1
[Modify] It is restricted
sta Jul 3, 2025
9705448
[Modify] Polish it
sta Jul 4, 2025
3df97bb
[Modify] It is restricted
sta Jul 5, 2025
543a06e
[Modify] It is restricted
sta Jul 6, 2025
1554ade
[Modify] It is restricted
sta Jul 7, 2025
73f30a4
[Modify] It is restricted
sta Jul 8, 2025
3cff458
[Modify] It is restricted
sta Jul 9, 2025
ef6929b
[Modify] It is restricted
sta Jul 9, 2025
a4c5566
[Modify] It is restricted
sta Jul 10, 2025
941d09b
[Modify] It is restricted
sta Jul 11, 2025
51fc9fa
[Modify] Send it if any
sta Jul 12, 2025
75b2c06
[Modify] Return it if any
sta Jul 13, 2025
09a25e2
[Modify] Add the SetUserHeader method
sta Jul 14, 2025
66d9a55
[Modify] Log it
sta Jul 15, 2025
71d85bd
[Modify] Send it
sta Jul 16, 2025
87e788b
[Modify] Add the UserHeadersResponder property
sta Jul 17, 2025
1afb037
[Modify] Polish it
sta Jul 18, 2025
e6c7064
[Modify] Return it
sta Jul 19, 2025
5b55d71
[Modify] Log it
sta Jul 20, 2025
7d19b37
[Modify] Polish it
sta Jul 21, 2025
80e78a4
[Modify] Add the HandshakeResponseHeaders property
sta Jul 22, 2025
d978b13
[Modify] Receive it
sta Jul 23, 2025
05d30e3
[Modify] Polish it
sta Jul 24, 2025
841edd4
[Modify] Polish it
sta Jul 24, 2025
a222f76
[Modify] Test it
sta Jul 25, 2025
3f9d014
[Modify] Add the CookiesResponder property
sta Jul 26, 2025
5e45b9f
[Modify] Replace it
sta Jul 27, 2025
20d4dcf
[Modify] Replace it
sta Jul 27, 2025
edba65e
[Modify] Polish it
sta Jul 27, 2025
a1e5a03
[Modify] Replace it
sta Jul 28, 2025
c454f58
[Modify] Return it
sta Jul 29, 2025
699181a
[Modify] Edit it
sta Jul 30, 2025
2add469
[Modify] Remove the CookiesValidator property
sta Jul 31, 2025
9d7637c
[Modify] Add it
sta Aug 1, 2025
e12518e
[Modify] Edit it
sta Aug 1, 2025
78cfefa
[Modify] Add it
sta Aug 2, 2025
5547ad0
[Modify] Use it
sta Aug 2, 2025
ae1c501
[Modify] Add it
sta Aug 2, 2025
18051fd
[Modify] Separate it
sta Aug 4, 2025
09d1058
[Modify] Edit it
sta Aug 5, 2025
6ee6687
[Modify] Edit it
sta Aug 6, 2025
1020f0e
[Modify] Edit it
sta Aug 7, 2025
c6a41cb
[Modify] Polish it
sta Aug 8, 2025
45d0695
[Modify] Polish it
sta Aug 9, 2025
1d51a67
[Modify] Polish it
sta Aug 10, 2025
2a719bc
[Modify] Polish it
sta Aug 11, 2025
4eb0522
[Modify] Add the HandshakeResponseCookies property
sta Aug 12, 2025
ebda304
[Modify] Polish it
sta Aug 13, 2025
35aa70e
[Modify] Polish it
sta Aug 14, 2025
eaaa552
[Modify] Replace it
sta Aug 14, 2025
f95ee8e
[Modify] Remove the Cookies property
sta Aug 15, 2025
bfe019c
[Modify] Rename it
sta Aug 16, 2025
773cd90
[Modify] Initialize it
sta Aug 17, 2025
546293a
[Modify] Add it
sta Aug 18, 2025
0c1d068
[Modify] Use it
sta Aug 19, 2025
2615365
[Modify] Add it
sta Aug 20, 2025
c56fc90
[Modify] Replace it
sta Aug 21, 2025
2ac4220
[Modify] Replace it
sta Aug 22, 2025
1e6e223
[Modify] Edit it
sta Aug 23, 2025
01a1a75
[Modify] Edit it
sta Aug 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions Example/Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug_Ubuntu</OutputPath>
<DefineConstants>DEBUG,UBUNTU</DefineConstants>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
Expand All @@ -43,16 +43,12 @@
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Release_Ubuntu</OutputPath>
<DefineConstants>UBUNTU</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
<Package>notify-sharp</Package>
</Reference>
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
Expand All @@ -65,7 +61,5 @@
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Notifier.cs" />
<Compile Include="NotificationMessage.cs" />
</ItemGroup>
</Project>
24 changes: 0 additions & 24 deletions Example/NotificationMessage.cs

This file was deleted.

81 changes: 0 additions & 81 deletions Example/Notifier.cs

This file was deleted.

141 changes: 81 additions & 60 deletions Example/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,104 +18,125 @@ public static void Main (string[] args)
// If you would like to connect to the server with the secure connection,
// you should create a new instance with a wss scheme WebSocket URL.

using (var nf = new Notifier ())
using (var ws = new WebSocket ("ws://echo.websocket.org"))
//using (var ws = new WebSocket ("wss://echo.websocket.org"))
//using (var ws = new WebSocket ("ws://localhost:4649/Echo"))
//using (var ws = new WebSocket ("wss://localhost:5963/Echo"))
//using (var ws = new WebSocket ("ws://localhost:4649/Echo?name=nobita"))
//using (var ws = new WebSocket ("wss://localhost:5963/Echo?name=nobita"))
//using (var ws = new WebSocket ("ws://localhost:4649/Chat"))
using (var ws = new WebSocket ("ws://localhost:4649/Chat"))
//using (var ws = new WebSocket ("wss://localhost:5963/Chat"))
//using (var ws = new WebSocket ("ws://localhost:4649/Chat?name=nobita"))
//using (var ws = new WebSocket ("wss://localhost:5963/Chat?name=nobita"))
{
// Set the WebSocket events.

ws.OnOpen += (sender, e) => ws.Send ("Hi, there!");

ws.OnMessage += (sender, e) =>
nf.Notify (
new NotificationMessage {
Summary = "WebSocket Message",
Body = !e.IsPing ? e.Data : "Received a ping.",
Icon = "notification-message-im"
}
);

ws.OnError += (sender, e) =>
nf.Notify (
new NotificationMessage {
Summary = "WebSocket Error",
Body = e.Message,
Icon = "notification-message-im"
}
);

ws.OnClose += (sender, e) =>
nf.Notify (
new NotificationMessage {
Summary = String.Format ("WebSocket Close ({0})", e.Code),
Body = e.Reason,
Icon = "notification-message-im"
}
);
#if DEBUG
// To change the logging level.
ws.Log.Level = LogLevel.Trace;

// To change the wait time for the response to the Ping or Close.
//ws.WaitTime = TimeSpan.FromSeconds (10);
// To enable the Per-message Compression extension.
//ws.Compression = CompressionMethod.Deflate;

// To emit a WebSocket.OnMessage event when receives a ping.
//ws.EmitOnPing = true;
#endif
// To enable the Per-message Compression extension.
//ws.Compression = CompressionMethod.Deflate;

// To enable the redirection.
//ws.EnableRedirection = true;

// To disable a delay when send or receive buffer of the underlying
// TCP socket is not full.
ws.NoDelay = true;

// To send the Origin header.
//ws.Origin = "http://localhost:4649";

// To send the cookies.
//ws.SetCookie (new Cookie ("name", "nobita"));
//ws.SetCookie (new Cookie ("roles", "\"idiot, gunfighter\""));

// To send the credentials for the HTTP Authentication (Basic/Digest).
//ws.SetCredentials ("nobita", "password", false);

// To connect through the HTTP Proxy server.
//ws.SetProxy ("http://localhost:3128", "nobita", "password");

// To send a user header.

var reqHeader = "HeaderFromClient";
var resHeader = "HeaderFromServer";

ws.SetUserHeader (reqHeader, resHeader);


// To validate the server certificate.
/*
ws.SslConfiguration.ServerCertificateValidationCallback =
(sender, certificate, chain, sslPolicyErrors) => {
ws.Log.Debug (
String.Format (
"Certificate:\n- Issuer: {0}\n- Subject: {1}",
certificate.Issuer,
certificate.Subject
)
);
var fmt = "Certificate:\n- Issuer: {0}\n- Subject: {1}";
var msg = String.Format (
fmt,
certificate.Issuer,
certificate.Subject
);

ws.Log.Debug (msg);

return true; // If the server certificate is valid.
};
*/

// To send the credentials for the HTTP Authentication (Basic/Digest).
//ws.SetCredentials ("nobita", "password", false);
// To change the wait time for the response to the Ping or Close.
//ws.WaitTime = TimeSpan.FromSeconds (10);
#endif
// Set the WebSocket events.

// To send the Origin header.
//ws.Origin = "http://localhost:4649";
ws.OnClose +=
(sender, e) => {
var fmt = "[WebSocket Close ({0})] {1}";

// To send the cookies.
//ws.SetCookie (new Cookie ("name", "nobita"));
//ws.SetCookie (new Cookie ("roles", "\"idiot, gunfighter\""));
Console.WriteLine (fmt, e.Code, e.Reason);
};

// To connect through the HTTP Proxy server.
//ws.SetProxy ("http://localhost:3128", "nobita", "password");
ws.OnError +=
(sender, e) => {
var fmt = "[WebSocket Error] {0}";

// To enable the redirection.
//ws.EnableRedirection = true;
Console.WriteLine (fmt, e.Message);
};

ws.OnMessage +=
(sender, e) => {
var fmt = e.IsPing
? "[WebSocket Ping] {0}"
: "[WebSocket Message] {0}";

Console.WriteLine (fmt, e.Data);
};

ws.OnOpen +=
(sender, e) => {
#if DEBUG
var val = ws.HandshakeResponseHeaders[resHeader];

if (!val.IsNullOrEmpty ()) {
var fmt = "[WebSocket Open] {0}: {1}";

Console.WriteLine (fmt, resHeader, val);
}
#endif
ws.Send ("Hi, there!");
};

// Connect to the server.
ws.Connect ();

// Connect to the server asynchronously.
//ws.ConnectAsync ();

Console.WriteLine ("\nType 'exit' to exit.\n");
Console.WriteLine ("\nType \"exit\" to exit.\n");

while (true) {
Thread.Sleep (1000);

Console.Write ("> ");

var msg = Console.ReadLine ();

if (msg == "exit")
break;

Expand Down
26 changes: 0 additions & 26 deletions Example1/AssemblyInfo.cs

This file was deleted.

Loading