Skip to content

Conversation

holasoyender
Copy link

This is a suggestion that was discussed on the Discord support server. Related to lavalink-devs/lavalink-client#34, #1135 and holasoyender/lavalink-client@8dfaf59

This pull request adds the option for clients to set a User-Agent header on socket connections and HTTP requests to set extra information about the bot.

Headers example (for websockets)

Authorization: youshallnotpass
User-Id: 170939974227541168
Client-Name: lavalink-client/2.0.0
User-Agent: TestBot/1.0.0

Headers example (for http requests)

Authorization: youshallnotpass
User-Agent: TestBot/1.0.0

When the User-Agent header is set, every log will have a prefix to identify the client its coming from.

…connection.

Adding documentation for client libraries to include the User-Agent header
Copy link
Member

@topi314 topi314 left a comment

Choose a reason for hiding this comment

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

I just tested this and there are a few places where this seems to be missing:

additionally your logging format is too different from how lavalink logs used to look
old:
2025-04-12T17:42:28.957+02:00 TRACE 28436 --- [Lavalink] [ XNIO-1 I/O-9] lavalink.server.io.SocketContext : Sent {"op":"playerUpdate","state":{"time":1744472548956,"position":0,"connected":true,"ping":0},"guildId":"1082302532421943407"}

new:
--2025-04-12T17:38:59.899+02:00 -TRACE 9496 --- [ XNIO-1 I/O-15] lavalink.server.io.SocketContext Sent {"op":"playerUpdate","state":{"time":1744472339898,"position":114960,"connected":true,"ping":7},"guildId":"1082302532421943407"}

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

Successfully merging this pull request may close these issues.

3 participants