[
https://issues.apache.org/jira/browse/TINKERPOP-2015?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16637949#comment-16637949
]
ASF GitHub Bot commented on TINKERPOP-2015:
-------------------------------------------
Github user FlorianHockmann commented on the issue:
https://github.com/apache/tinkerpop/pull/928
@deejvince: Did you see [the integration
test](https://github.com/apache/tinkerpop/blob/master/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Driver/GremlinClientTests.cs#L233)
added with this PR?
The relevant part is basically this:
```cs
var webSocketConfiguration =
new Action<ClientWebSocketOptions>(options =>
{
options.UseDefaultCredentials = false;
options.KeepAliveInterval =
TimeSpan.FromMilliseconds(11);
});
var gremlinClient = new GremlinClient(gremlinServer,
webSocketConfiguration: webSocketConfiguration);
```
The `Action` you provide will be called for every `ClientWebSocket` created
by the driver of Gremlin.Net.
I haven't tested that specifically, but it should also be possible to set a
request header like this:
```cs
var webSocketConfiguration =
new Action<ClientWebSocketOptions>(options =>
{
options.SetRequestHeader("Authorization", "Bearer " +
token);
});
```
Please report back if that doesn't work.
> Allow users to configure the WebSocket connections
> --------------------------------------------------
>
> Key: TINKERPOP-2015
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2015
> Project: TinkerPop
> Issue Type: Improvement
> Components: dotnet
> Affects Versions: 3.3.3, 3.2.9
> Reporter: Florian Hockmann
> Assignee: Florian Hockmann
> Priority: Major
> Fix For: 3.4.0, 3.3.4, 3.2.10
>
>
> Gremlin.Net currently just creates instances of the {{ClientWebSocket}} class
> with default options. That is probably appropriate for most users but it
> makes it impossible to change the config and use certain features like client
> certificates or proxy settings.
> We could simply allow users to provide a
> [{{ClientWebSocketOptions}}|https://docs.microsoft.com/dotnet/api/system.net.websockets.clientwebsocketoptions]
> object. Since it's part of .NET Standard (and not a 3rd party library) it
> shouldn't be a problem to expose this type. This would also have the nice
> advantage that users could immediately use new options like the
> {{[RemoteCertificateValidationCallback|https://docs.microsoft.com/dotnet/api/system.net.websockets.clientwebsocketoptions.remotecertificatevalidationcallback]}}
> that was just added in .NET Core 2.1.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)