Skip to content

Commit 5fc1701

Browse files
committed
update server
1 parent 5d81c1a commit 5fc1701

18 files changed

+795
-6
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ npm-debug.log
1313
# other
1414
# dist/
1515
# !dist/*.html
16-
17-
java/**/*.java

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ A tool to debug websocket/sockjs/stomp.
44

55
![](screenshot.png)
66

7-
# Features
7+
## Features
88

99
* support WebSocket/[SockJS](https://github.com/sockjs/sockjs-client), with or without [STOMP](https://github.com/jmesnil/stomp-websocket)
1010
* React + ES6 + webpack + [Ant Design](https://github.com/ant-design/ant-design)
1111

12-
# Quick Start
12+
## Quick Start
1313

1414
Open [http://jiangxy.github.io/websocket-debug-tool](http://jiangxy.github.io/websocket-debug-tool) and use directly. Pay attention to Cross-Domain Policy.
1515

@@ -20,11 +20,11 @@ If you wanna modify the source code:
2020
3. `npm run dev` to start webpack-dev-server (with react-hot-loader)
2121
4. open `http://localhost:4040`
2222

23-
# Spring-based server
23+
## Spring-based server
2424

2525
There is a spring-based WebSocket server in the [java](java) folder for test purpose. View [Doc](java/README.md).
2626

27-
# Browsers support
27+
## Browsers support
2828

2929
| [<img src="https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png" alt="Chrome" width="16px" height="16px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome |
3030
| --------- |

java/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# A spring-based WebSocket server for test
2+
3+
With Spring 4.2.6.
4+
5+
## Quick Start
6+
7+
1. you need maven 3.
8+
2. `git clone` and `mvn jetty:run` to start the embedded Jetty server.
9+
3. open `http://localhost:8080/index.html` and enjoy.
10+
11+
## WebSocket URI
12+
13+
Once the Jetty server started, there are some URI available for WebSocket transport:
14+
15+
1. `ws://localhost:8080/handlerA` and `ws://localhost:8080/handlerB` for raw WebSocket.
16+
2. `http://localhost:8080/sockjs/handlerA` and `http://localhost:8080/sockjs/handlerB` for SockJS.
17+
3. `ws://localhost:8080/stomp` for raw WebSocket + STOMP.
18+
4. `http://localhost:8080/stomp` for SockJS + STOMP.
19+
20+
For more detail, view [SpringMVC.xml](src/main/resources/springMVC.xml).

java/pom.xml

Lines changed: 323 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<groupId>me.jxy</groupId>
7+
<artifactId>websocket-demo</artifactId>
8+
<packaging>war</packaging>
9+
<version>1.0.0-SNAPSHOT</version>
10+
11+
<name>websocket-demo</name>
12+
<description>测试websocket用的demo</description>
13+
14+
<developers>
15+
<developer>
16+
<id>jiangxy</id>
17+
<name>jiangxy</name>
18+
<email>[email protected]</email>
19+
<timezone>+8</timezone>
20+
</developer>
21+
</developers>
22+
23+
<properties>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
26+
<maven.compiler.target>1.7</maven.compiler.target>
27+
<maven.compiler.source>1.7</maven.compiler.source>
28+
29+
<!-- 常用工具 -->
30+
<guava.version>15.0</guava.version>
31+
<spring.version>4.2.6.RELEASE</spring.version>
32+
</properties>
33+
34+
<dependencyManagement>
35+
<dependencies>
36+
<!-- spring -->
37+
<dependency>
38+
<groupId>org.springframework</groupId>
39+
<artifactId>spring-context</artifactId>
40+
<version>${spring.version}</version>
41+
</dependency>
42+
<dependency>
43+
<groupId>org.springframework</groupId>
44+
<artifactId>spring-webmvc</artifactId>
45+
<version>${spring.version}</version>
46+
</dependency>
47+
<dependency>
48+
<groupId>org.springframework</groupId>
49+
<artifactId>spring-orm</artifactId>
50+
<version>${spring.version}</version>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.springframework</groupId>
54+
<artifactId>spring-aop</artifactId>
55+
<version>${spring.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.aspectj</groupId>
59+
<artifactId>aspectjrt</artifactId>
60+
<version>1.6.11</version>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.aspectj</groupId>
64+
<artifactId>aspectjweaver</artifactId>
65+
<version>1.6.11</version>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.springframework</groupId>
69+
<artifactId>spring-messaging</artifactId>
70+
<version>${spring.version}</version>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.springframework</groupId>
74+
<artifactId>spring-websocket</artifactId>
75+
<version>${spring.version}</version>
76+
</dependency>
77+
78+
<!-- logging -->
79+
<dependency>
80+
<groupId>ch.qos.logback</groupId>
81+
<artifactId>logback-classic</artifactId>
82+
<version>1.1.3</version>
83+
</dependency>
84+
<dependency>
85+
<groupId>org.slf4j</groupId>
86+
<artifactId>slf4j-api</artifactId>
87+
<version>1.7.12</version>
88+
</dependency>
89+
<dependency>
90+
<groupId>org.slf4j</groupId>
91+
<artifactId>jcl-over-slf4j</artifactId>
92+
<version>1.7.12</version>
93+
</dependency>
94+
95+
<dependency>
96+
<groupId>javax.servlet</groupId>
97+
<artifactId>javax.servlet-api</artifactId>
98+
<version>3.1.0</version>
99+
<scope>provided</scope>
100+
</dependency>
101+
<dependency>
102+
<groupId>javax.websocket</groupId>
103+
<artifactId>javax.websocket-api</artifactId>
104+
<version>1.1</version>
105+
<scope>provided</scope>
106+
</dependency>
107+
108+
<dependency>
109+
<groupId>com.google.guava</groupId>
110+
<artifactId>guava</artifactId>
111+
<version>${guava.version}</version>
112+
</dependency>
113+
114+
<dependency>
115+
<groupId>com.alibaba</groupId>
116+
<artifactId>fastjson</artifactId>
117+
<version>1.2.6</version>
118+
</dependency>
119+
120+
<dependency>
121+
<groupId>joda-time</groupId>
122+
<artifactId>joda-time</artifactId>
123+
<version>2.6</version>
124+
</dependency>
125+
126+
<!-- apache commons -->
127+
<dependency>
128+
<groupId>commons-lang</groupId>
129+
<artifactId>commons-lang</artifactId>
130+
<version>2.6</version>
131+
</dependency>
132+
<dependency>
133+
<groupId>commons-codec</groupId>
134+
<artifactId>commons-codec</artifactId>
135+
<version>1.10</version>
136+
</dependency>
137+
<dependency>
138+
<groupId>commons-fileupload</groupId>
139+
<artifactId>commons-fileupload</artifactId>
140+
<version>1.2.2</version>
141+
</dependency>
142+
143+
<!-- jackson -->
144+
<dependency>
145+
<groupId>com.fasterxml.jackson.core</groupId>
146+
<artifactId>jackson-databind</artifactId>
147+
<version>2.4.1</version>
148+
</dependency>
149+
<dependency>
150+
<groupId>com.fasterxml.jackson.core</groupId>
151+
<artifactId>jackson-core</artifactId>
152+
<version>2.4.1</version>
153+
</dependency>
154+
155+
</dependencies>
156+
</dependencyManagement>
157+
158+
<dependencies>
159+
<!-- 测试 -->
160+
<dependency>
161+
<groupId>junit</groupId>
162+
<artifactId>junit</artifactId>
163+
<version>4.8.2</version>
164+
<scope>test</scope>
165+
</dependency>
166+
<dependency>
167+
<groupId>org.mockito</groupId>
168+
<artifactId>mockito-all</artifactId>
169+
<version>1.9.5</version>
170+
<scope>test</scope>
171+
</dependency>
172+
<dependency>
173+
<groupId>org.springframework</groupId>
174+
<artifactId>spring-test</artifactId>
175+
<version>${spring.version}</version>
176+
<scope>test</scope>
177+
</dependency>
178+
179+
<!-- lombok 1.16.*版本和compiler插件2.3版本有冲突 -->
180+
<dependency>
181+
<groupId>org.projectlombok</groupId>
182+
<artifactId>lombok</artifactId>
183+
<version>1.14.4</version>
184+
<scope>provided</scope>
185+
</dependency>
186+
187+
<!-- spring -->
188+
<dependency>
189+
<groupId>org.springframework</groupId>
190+
<artifactId>spring-context</artifactId>
191+
</dependency>
192+
<dependency>
193+
<groupId>org.springframework</groupId>
194+
<artifactId>spring-webmvc</artifactId>
195+
</dependency>
196+
<dependency>
197+
<groupId>org.springframework</groupId>
198+
<artifactId>spring-orm</artifactId>
199+
</dependency>
200+
<dependency>
201+
<groupId>org.springframework</groupId>
202+
<artifactId>spring-aop</artifactId>
203+
</dependency>
204+
<dependency>
205+
<groupId>org.aspectj</groupId>
206+
<artifactId>aspectjrt</artifactId>
207+
</dependency>
208+
<dependency>
209+
<groupId>org.aspectj</groupId>
210+
<artifactId>aspectjweaver</artifactId>
211+
</dependency>
212+
<dependency>
213+
<groupId>org.springframework</groupId>
214+
<artifactId>spring-messaging</artifactId>
215+
</dependency>
216+
<dependency>
217+
<groupId>org.springframework</groupId>
218+
<artifactId>spring-websocket</artifactId>
219+
</dependency>
220+
221+
<!-- logging -->
222+
<dependency>
223+
<groupId>ch.qos.logback</groupId>
224+
<artifactId>logback-classic</artifactId>
225+
</dependency>
226+
<dependency>
227+
<groupId>org.slf4j</groupId>
228+
<artifactId>slf4j-api</artifactId>
229+
</dependency>
230+
<dependency>
231+
<groupId>org.slf4j</groupId>
232+
<artifactId>jcl-over-slf4j</artifactId>
233+
</dependency>
234+
235+
<dependency>
236+
<groupId>javax.servlet</groupId>
237+
<artifactId>javax.servlet-api</artifactId>
238+
</dependency>
239+
<dependency>
240+
<groupId>javax.websocket</groupId>
241+
<artifactId>javax.websocket-api</artifactId>
242+
</dependency>
243+
244+
<dependency>
245+
<groupId>com.google.guava</groupId>
246+
<artifactId>guava</artifactId>
247+
</dependency>
248+
249+
<dependency>
250+
<groupId>com.alibaba</groupId>
251+
<artifactId>fastjson</artifactId>
252+
</dependency>
253+
254+
<dependency>
255+
<groupId>com.fasterxml.jackson.core</groupId>
256+
<artifactId>jackson-databind</artifactId>
257+
</dependency>
258+
<dependency>
259+
<groupId>com.fasterxml.jackson.core</groupId>
260+
<artifactId>jackson-core</artifactId>
261+
</dependency>
262+
263+
</dependencies>
264+
265+
<build>
266+
<plugins>
267+
<plugin>
268+
<groupId>org.apache.maven.plugins</groupId>
269+
<artifactId>maven-compiler-plugin</artifactId>
270+
<version>2.3.2</version>
271+
<configuration>
272+
<source>1.7</source>
273+
<target>1.7</target>
274+
<encoding>UTF-8</encoding>
275+
<showWarnings>true</showWarnings>
276+
<showDeprecation>true</showDeprecation>
277+
</configuration>
278+
</plugin>
279+
280+
<plugin>
281+
<groupId>org.apache.maven.plugins</groupId>
282+
<artifactId>maven-resources-plugin</artifactId>
283+
<version>2.5</version>
284+
<configuration>
285+
<encoding>UTF-8</encoding>
286+
</configuration>
287+
</plugin>
288+
289+
<plugin>
290+
<groupId>org.apache.maven.plugins</groupId>
291+
<artifactId>maven-source-plugin</artifactId>
292+
<version>2.1.2</version>
293+
<executions>
294+
<execution>
295+
<id>attach-sources</id>
296+
<phase>compile</phase>
297+
<goals>
298+
<goal>jar</goal>
299+
</goals>
300+
</execution>
301+
</executions>
302+
</plugin>
303+
304+
<plugin>
305+
<groupId>org.eclipse.jetty</groupId>
306+
<artifactId>jetty-maven-plugin</artifactId>
307+
<version>9.2.8.v20150217</version>
308+
<configuration>
309+
<!-- <scanIntervalSeconds>10</scanIntervalSeconds> -->
310+
<reload>manual</reload>
311+
<dumpOnStart>false</dumpOnStart>
312+
<webApp>
313+
<contextPath>/</contextPath>
314+
</webApp>
315+
<!-- <requestLog implementation="org.eclipse.jetty.server.NCSARequestLog"> <logDateFormat>yyyy-MM-dd HH:mm:ss</logDateFormat>
316+
<logTimeZone>GMT+8:00</logTimeZone> <logServer>true</logServer> <logCookies>true</logCookies> </requestLog> -->
317+
</configuration>
318+
</plugin>
319+
320+
</plugins>
321+
</build>
322+
323+
</project>

0 commit comments

Comments
 (0)