Skip to content

Comments

Log websocket IP addresses and server host:port#97

Open
roguh wants to merge 2 commits intopuhitaku:masterfrom
roguh:feature/log-ip-and-add-gha
Open

Log websocket IP addresses and server host:port#97
roguh wants to merge 2 commits intopuhitaku:masterfrom
roguh:feature/log-ip-and-add-gha

Conversation

@roguh
Copy link
Contributor

@roguh roguh commented Sep 27, 2025

  • Log host:port
  • Log client IP for every websocket message received

Example:

$ mtplvcap -debug server
[0000]  INFO usb: found: ...
[0000]  INFO usb: found: ...
[0000]  WARN mtp: detected more than 1 device
[0000]  INFO mtp: opening the detected Nikon .....
[0000]  INFO main: server started on http://localhost:42839
[0000]  INFO main: started
[0000] DEBUG lv: manufacturer = NIKON, product = NIKON ..., serialnumber = ...
[0000] DEBUG lv: model didn't match, falling back to the generic model 
[0000]  INFO lv: HandleStream 127.0.0.1:40964: websocket client connected
[0000]  INFO lv: HandleStream 127.0.0.1:40974: websocket client connected
[0000]  INFO lv: HandleControl 127.0.0.1:40980: websocket client connected
[0001]  INFO lv: getting available resolutions
[0001]  INFO lv: available resolutions (higher is larger): [1 2 3]
[0001]  INFO lv: automatically use the largest choice: 3
[0002]  INFO lv: HandleControl 127.0.0.1:40994: websocket client connected
[0005] DEBUG lv: HandleControl 127.0.0.1:40994: set rate limit: 30
[0006] DEBUG lv: HandleControl 127.0.0.1:40994: disable rate limit
[0008] ERROR lv: HandleControl 127.0.0.1:40994: failed to read a message: websocket: close 1001 (going away)
[0008]  INFO http: GET /control 127.0.0.1:40994

The http GET logs are also logging IP addresses.

@roguh roguh force-pushed the feature/log-ip-and-add-gha branch from 94b6f25 to a792ae7 Compare September 27, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant