Skip to content

Commit 803ba85

Browse files
committed
more
1 parent 1d7f930 commit 803ba85

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

16-https/createcert.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
#create private key
3+
openssl genrsa -out private-key.pem 2048
4+
5+
#create certificate and self-sign it with the private key
6+
openssl req -new -x509 -key private-key.pem -out certificate.pem -days 365
File renamed without changes.

19-udp/190-UDP-Server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ server.on('listening', () => {
1111
console.log(`server listening ${address.address}:${address.port}`);
1212
});
1313

14-
server.bind(41234);
15-
// Prints: server listening 0.0.0.0:41234
14+
server.bind(3333);
15+
// Prints: server listening 0.0.0.0:3333

19-udp/191-UDP-Client.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ client.on('message', (msg, rinfo) => {
55
console.log(`client got: ${msg} from ${rinfo.address}:${rinfo.port}`);
66
});
77

8+
//optional but we can bind to a random port of our choice
9+
client.bind(55555);
10+
811
client.connect( 3333,"127.0.0.1", () => {
912
console.log ("server exists .. send something.. ")
1013
//notice that its called send and not write

20-streams/203-pipe.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//chaining pipes
2-
//we read, , encrypt,compress write..
2+
//we read, , encrypt (duplex),compress (duplex) -> write..
3+
4+
//readstream --> (write) encrypt (duplex) (read) -> (write) compress (read) --> write to file
35
const fs = require('fs');
46
const crypto = require('crypto');
57
const gzip = require('node:zlib').createGzip();

0 commit comments

Comments
 (0)