Commit 96d07da0 authored by Dennis Willers's avatar Dennis Willers 🏀

Just show content-length in header

parent 72d61906
Pipeline #417 passed with stages
in 2 minutes and 46 seconds
...@@ -74,7 +74,7 @@ server.on('connection',function(socket){ ...@@ -74,7 +74,7 @@ server.on('connection',function(socket){
.then(res => { .then(res => {
console.log('Prepare: ', res.headers, res.data); console.log('Prepare: ', res.headers, res.data);
//echo data //echo data
var is_kernel_buffer_full = socket.write(JSON.stringify(res.headers) + '\n\n' + JSON.stringify(res.data) + '\n'); var is_kernel_buffer_full = socket.write('content-length:'+res.headers['content-length'] + '\n\n' + JSON.stringify(res.data) + '\n');
if(is_kernel_buffer_full){ if(is_kernel_buffer_full){
console.log('Data was flushed successfully from kernel buffer i.e written successfully!'); console.log('Data was flushed successfully from kernel buffer i.e written successfully!');
}else{ }else{
...@@ -217,7 +217,7 @@ client.on('data',function(data){ ...@@ -217,7 +217,7 @@ client.on('data',function(data){
// 87.78.129.86 // 87.78.129.86
/*onst clients = net.connect({host: 'localhost', port: 3000}, () => { const clients = net.connect({host: 'localhost', port: 3000}, () => {
console.log('connected to server!'); console.log('connected to server!');
clients.write('Hello World Client!\r\n'); clients.write('Hello World Client!\r\n');
//test(clients); //test(clients);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment