By Guest on Saturday, 20 April 2024
Posted in General
Replies 4
Likes 0
Views 162
Votes 0
Is it possible to set the server identifier (the one that is sent in the response header) to a custom value?
The component I tried to use is the TsgcWebSocketHTTPServer, and the default identifier is "sgcWebSockets" and the version nr.

I tried to add a handshake event, and replace that specific header ("Server"), but that did not do any difference.
Hello,

Use the property Options.Software to customize the value of the Server HTTP Header. This property is available from the sgcWebSockets 2024.4.0 version.


TsgcWebSocketHTTPServer.Options.Software := 'Server Name';


Kind Regards,
Sergio
·
4 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for the quick reply!
I also tried, with the same event, to add a custom header, but also that does not seem to be sent to the client. It seems to all be replaced with the default headers. Is there also a way to add custom headers from the server that are sent in the same way?
·
4 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
This is what I added in the OnHandshake Event:

Headers.Add('Jonas: test');
·
4 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

No, the Server header must be set with the property Options.Software, this is the only way.

Kind Regards,
Sergio
·
4 weeks ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post