Skip to content

Conversation

@fortuna
Copy link
Collaborator

@fortuna fortuna commented Aug 13, 2025

This PR adds support for usage reporting. The config format looks like this:

transport:
  $type: tcpudp
  tcp:
      $type: shadowsocks
      endpoint: example.com:80
      <<: &cipher
        cipher: chacha20-ietf-poly1305
        secret: SECRET
      prefix: "POST "
  udp:
      $type: shadowsocks
      endpoint: example.com:53
      <<: *cipher

reporter:
  $type: http
  url: https://your-callback-server.com/outline_callback
  interval: 1h

The http reporter will send a POST request to the given URL at the beginning of the session, and then every interval.

/cc @emohandesi @62w71st

@fortuna fortuna requested review from Copilot and jyyi1 August 13, 2025 22:59
@fortuna fortuna requested review from a team as code owners August 13, 2025 22:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

@jyyi1 jyyi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the implementation. Logic is clear, added a few comments.

Copy link
Collaborator Author

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick review. I'll try to address them tomorrow morning.

@fortuna fortuna requested a review from jyyi1 August 14, 2025 14:32
Copy link
Contributor

@jyyi1 jyyi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM now. It would be good to go after fixing the race condition caught by CI.

@fortuna fortuna requested a review from jyyi1 August 14, 2025 18:32
Copy link
Collaborator Author

@fortuna fortuna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition fixed with the Go 1.25 upgrade, which also brings performance and security improvements from Go 1.23 and 1.24.

@fortuna fortuna enabled auto-merge (squash) August 14, 2025 18:34
@fortuna
Copy link
Collaborator Author

fortuna commented Aug 14, 2025

FYI, I had to fix an issue caused by the upgrade to 1.25 and Go Mobile: golang/go#71827

@fortuna fortuna merged commit e84007f into master Aug 14, 2025
24 checks passed
@fortuna fortuna deleted the fortuna-report branch August 14, 2025 20:14
@emohandesi
Copy link
Contributor

What is the use case scenario for this reporter that sends a POST request to a server periodically?

@fortuna
Copy link
Collaborator Author

fortuna commented Aug 18, 2025

@emohandesi You guys requested it (every 24h). We can remove it though.

@emohandesi
Copy link
Contributor

@emohandesi You guys requested it (every 24h). We can remove it though.

OK, I see. I thought there was another use case for it. I was trying to figure out if we could somehow take advantage of it.

@sahin141
Copy link

The new update introduced usage reporting via the HTTP reporter, which sends a POST request to the configured URL at the start of the session and then at every interval. However, I noticed that it only sends the request if the connection is successful.

With this method, is it possible to also receive error messages or connection failure reports through the same reporting mechanism?

@emohandesi
Copy link
Contributor

The new update introduced usage reporting via the HTTP reporter, which sends a POST request to the configured URL at the start of the session and then at every interval. However, I noticed that it only sends the request if the connection is successful.

With this method, is it possible to also receive error messages or connection failure reports through the same reporting mechanism?

No, sending the connection error is not possible in this feature. #2036 and #2484 are implementing the error reporting feature.

@khantzawhein
Copy link
Contributor

khantzawhein commented Sep 3, 2025

Hello, @fortuna, could you give me some insight into how this feature works and what the use case for it is?

I have been looking for this feature's documentation on Google Developer, but it seems like this feature has not been added to the documentation yet.

Edit: Doc found on https://github.com/Jigsaw-Code/outline-apps/blob/master/client/config.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants