Skip to content

Instantly share code, notes, and snippets.

@Test(groups = { "online", "default_provider" })
public void testWssRequestProxy() throws IOException, InterruptedException, ExecutionException, TimeoutException {
AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
b.setFollowRedirects(true);
ProxyServer ps = new ProxyServer(ProxyServer.Protocol.HTTPS, "127.0.0.1", port1);
AsyncHttpClientConfig config = b.build();
AsyncHttpClient asyncHttpClient = getAsyncHttpClient(config);
try {
5:58:55.964 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=299, memory: total:505 MB, max:505 MB, free:2 MB, used=503 MB
15:58:59.130 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=303, memory: total:505 MB, max:505 MB, free:1 MB, used=504 MB
15:59:01.680 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=307, memory: total:505 MB, max:505 MB, free:2 MB, used=503 MB
15:59:07.154 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=311, memory: total:505 MB, max:505 MB, free:0 MB, used=505 MB
15:59:10.189 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=320, memory: total:505 MB, max:505 MB, free:0 MB, used=505 MB
15:59:13.497 [main] INFO com.poweredbypace.pace.AtmoTest - Num connections=324, memory: total:505 MB, max:505 MB, free:0 MB, used=505 MB
15:59:18.675 [New I/O worker #1] DEBUG o.a.nettosphere.BridgeRuntime - Exception
java.lang.OutOfMemoryError: Java heap space
15:59:18.676 [New I/O worker #1] DEBUG o.a.nettosphere.BridgeRuntime - E
@jfarcand
jfarcand / gist:8852670
Created February 6, 2014 21:20
Netty Byte Copy Writer
/*
* Copyright 2014 Jeanfrancois Arcand
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@PushEndpoint("/chat/{room}")
@Singleton
public class ChatResource {
private final Logger logger = LoggerFactory.getLogger(ChatResource.class);
/**
* The client is sending a JSON message which is decoded as Message object. From the Message, we grab the
* remote's endpoint userName and create a PrivateTarget. The PrivateTarget will be used when a message
* needs to be delivered only to that connection.
T 127.0.0.1:61314 -> 127.0.0.1:8080 [AP]
GET /chat?X-Atmosphere-tracking-id=0&X-Atmosphere-Framework=2.1.4-javascript&X-Atmosphere-Transport=websocket&X-Atmosphere-TrackMessageSize=true&X-Cache-Date=0&Content-Type=application/json&X-atmo-protocol=true HTTP/1.1.
Upgrade: websocket.
Connection: Upgrade.
Host: 127.0.0.1:8080.
Origin: http://127.0.0.1:8080.
Pragma: no-cache.
Cache-Control: no-cache.
Sec-WebSocket-Key: 8e5n55kJPeEH9LJjG2chWw==.
Sec-WebSocket-Version: 13.
@jfarcand
jfarcand / Atmosphere_Framework.md
Last active August 29, 2015 13:56
Atmosphere Framework

Atmosphere - Realtime Client Server Framework for the JVM, supporting WebSockets and Cross-Browser Fallbacks Support

  • Lightweight API for writing portable asynchronous applications
  • Use WebSockets when available, either by using Native WebSocket API or jsr 356, and fallback to HTTP when not. All transparent for application. Developers focus on business logic, not the protocol!!
  • Ship with Native Javascript and JQuery clients side library for websockets and fallback transports like Server Side Events, Streaming, JSONP, HTMLFILE and long-polling. Also have built in support for Javascript's library like Sockjs, Socket.IO, Cometd, GWT
  • An Atmosphere Application can be used with IE 6+, Opera 10+, Firefox 3.5+, Chrome 4+, Safari 3+ and server like JBoss 7+, GlassFish 2+, Tomcat 4+, Jetty 6+, Vert.x 1.0+, Netty 3.2+ TRANSPARENTLY, e.g without any change r
diff --git a/modules/javascript/src/main/webapp/javascript/atmosphere.js b/modules/javascript/src/main/webapp/javascript/atmosphere.js
index c519583..2ffcb01 100644
--- a/modules/javascript/src/main/webapp/javascript/atmosphere.js
+++ b/modules/javascript/src/main/webapp/javascript/atmosphere.js
@@ -1227,7 +1227,6 @@
}
if (!_request.enableProtocol) {
- webSocketOpened = true;
if (reopening) {
@ManagedService(path = "/pubsub{uc:/[A-Z]{3}[0-9]{4}}")
public class EventSocket {
@Message
public void onMessage(AtmosphereResponse response, String message) throws IOException {
response.write(message);
}
}
Caused by: java.lang.IllegalStateException: Blocking message pending 10000 for BLOCKING
at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.lockMsg(WebSocketRemoteEndpoint.java:120) ~[websocket-common-9.1.2.v20140210.jar:9.1.2.v20140210]
at org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint.sendString(WebSocketRemoteEndpoint.java:372) ~[websocket-common-9.1.2.v20140210.jar:9.1.2.v20140210]
at org.atmosphere.container.version.Jetty9WebSocket.write(Jetty9WebSocket.java:41) ~[atmosphere-runtime-2.1.0.jar:2.1.0]
<profiles>
<profile>
<id>sonatype-oss-release</id>
<properties>
<gpg.passphrase>XXXXXXX</gpg.passphrase>
<skipTests>true</skipTests>
</properties>
</profile>
<profile>
<id>release-profile</id>