This PR is not meant for direct merging, but rather for a discussion; the problem is that the API for SNI is available in Java8/Android API24 (the 'correct' implementation is in my branch https://github.com/ondrap/nv-websocket-client/tree/android-api24 ). This PR is rather slight refactoring that results in correct behaviour for direct connections on Android systems and possibly plain Java (tested with Java8). SNI in this case doesn't work for proxied connections as there is no API available to do that.
There is a slight drawback though, as there is no way to set connectionTimeout with the createSocket() call, so the system default is used. I'm OK with that for my use, however I am not sure if such a change is appropriate for the library.
This PR is not meant for direct merging, but rather for a discussion; the problem is that the API for SNI is available in Java8/Android API24 (the 'correct' implementation is in my branch https://github.com/ondrap/nv-websocket-client/tree/android-api24 ). This PR is rather slight refactoring that results in correct behaviour for direct connections on Android systems and possibly plain Java (tested with Java8). SNI in this case doesn't work for proxied connections as there is no API available to do that.
There is a slight drawback though, as there is no way to set connectionTimeout with the
createSocket()
call, so the system default is used. I'm OK with that for my use, however I am not sure if such a change is appropriate for the library.