Skip to content

Commit

Permalink
networkConnections() fix truncated ip6 addr (macOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Nov 24, 2023
1 parent f36b800 commit 453d338
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.

| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.21.17 | 2023-11-09 | `system()` Raspberry Pi 5 name fix |
| 5.21.18 | 2023-11-24 | `networkConnections()` fix truncated ip6 addr (macOS) |
| 5.21.17 | 2023-11-11 | `system()` Raspberry Pi 5 name fix |
| 5.21.16 | 2023-11-09 | `currentLoad()` improved parsing (linux) |
| 5.21.15 | 2023-10-27 | `wifiConnections()` improved parsing (linux) |
| 5.21.14 | 2023-10-26 | `execSync()` added explicit encoding (linux) |
Expand Down
5 changes: 5 additions & 0 deletions docs/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ <h3>Full version history</h3>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.21.18</th>
<td>2023-11-24</td>
<td><span class="code">networkConnections()</span> fix truncated ip6 addr (macOS)</td>
</tr>
<tr>
<th scope="row">5.21.17</th>
<td>2023-11-11</td>
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var package = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = package.version;
var packageVersion = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = packageVersion.version;
}
};
xhttp.open("GET", "https://registry.npmjs.org/systeminformation/latest", true);
Expand All @@ -79,9 +79,9 @@
backDelay: 1200,

};
var typed = new Typed('#typed', options);
return new Typed('#typed', options);
}
function scrollIt(destination, duration = 200, easing = 'linear', callback) {
function scrollIt(destination, duration, easing, callback) {

const easings = {
linear(t) {
Expand Down Expand Up @@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.21.17</span></div>
<div class="version">New Version: <span id="version">5.21.18</span></div>
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
</div>
<div class="down">
Expand Down
8 changes: 4 additions & 4 deletions docs/v4/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var package = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = package.version;
var packageVersion = JSON.parse(this.responseText);
document.getElementById("version").innerHTML = packageVersion.version;
}
};
xhttp.open("GET", "https://registry.npmjs.org/systeminformation/latest", true);
Expand All @@ -78,9 +78,9 @@
backDelay: 1200,

};
var typed = new Typed('#typed', options);
return new Typed('#typed', options);
}
function scrollIt(destination, duration = 200, easing = 'linear', callback) {
function scrollIt(destination, duration, easing, callback) {

const easings = {
linear(t) {
Expand Down
2 changes: 1 addition & 1 deletion lib/network.js
Original file line number Diff line number Diff line change
Expand Up @@ -1525,7 +1525,7 @@ function networkConnections(callback) {
}
if (_darwin) {
// let cmd = 'netstat -natv | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"';
let cmd = 'netstat -natv | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
let cmd = 'netstat -natvln | grep "tcp4\\|tcp6\\|udp4\\|udp6"';
const states = 'ESTABLISHED|SYN_SENT|SYN_RECV|FIN_WAIT1|FIN_WAIT2|TIME_WAIT|CLOSE|CLOSE_WAIT|LAST_ACK|LISTEN|CLOSING|UNKNOWN';
exec(cmd, { maxBuffer: 1024 * 20000 }, function (error, stdout) {
if (!error) {
Expand Down

0 comments on commit 453d338

Please sign in to comment.