forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebSocket implementation no proxy support (Azure#275)
* WebSocket implementation no proxy support (Azure#275)
- Loading branch information
Showing
21 changed files
with
1,278 additions
and
1,106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 31 additions & 31 deletions
62
azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
...vicebus/src/main/java/com/microsoft/azure/servicebus/amqp/WebSocketConnectionHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.microsoft.azure.servicebus.amqp; | ||
|
||
import com.microsoft.azure.proton.transport.ws.impl.WebSocketImpl; | ||
import com.microsoft.azure.servicebus.primitives.ClientConstants; | ||
import org.apache.qpid.proton.engine.Event; | ||
import org.apache.qpid.proton.engine.impl.TransportInternal; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class WebSocketConnectionHandler extends ConnectionHandler { | ||
|
||
private static final Logger TRACE_LOGGER = LoggerFactory.getLogger(ConnectionHandler.class); | ||
|
||
public WebSocketConnectionHandler(IAmqpConnection messagingFactory) | ||
{ | ||
super(messagingFactory); | ||
} | ||
|
||
@Override | ||
public void addTransportLayers(final Event event, final TransportInternal transport) | ||
{ | ||
final WebSocketImpl webSocket = new WebSocketImpl(); | ||
webSocket.configure( | ||
event.getConnection().getHostname(), | ||
"/$servicebus/websocket", | ||
null, | ||
0, | ||
"AMQPWSB10", | ||
null, | ||
null); | ||
|
||
transport.addTransportLayer(webSocket); | ||
|
||
if (TRACE_LOGGER.isInfoEnabled()) | ||
{ | ||
TRACE_LOGGER.info("addWebsocketHandshake: hostname[" + event.getConnection().getHostname() +"]"); | ||
} | ||
} | ||
|
||
@Override | ||
public int getPort() | ||
{ | ||
return ClientConstants.HTTPS_PORT; | ||
} | ||
|
||
@Override | ||
public int getMaxFrameSize() | ||
{ | ||
// This is the current limitation of https://github.com/Azure/qpid-proton-j-extensions | ||
// once, this library enables larger frames - this property can be removed. | ||
return 4 * 1024; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.