-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Websockets #1322
Draft
jbrichau
wants to merge
13
commits into
master
Choose a base branch
from
websockets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+788
−9
Draft
Websockets #1322
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
dd73c34
initial work on Seaside-WebSocket, inspired by Seaside-Comet
a8dc18e
added websocket packages to the baseline
c2aa27a
fix websockets in baseline
701487a
Move class ZnSeasideWebSocketDelegate to Seaside-WebSocket-Zinc package
c5ebab2
Created a dedicated request handler for websocket setup + some change…
0217078
pushing javascript for execution moved to separate subclass of websoc…
1611ec2
Some improvements to the code as per PR feedback
6307cfc
Added the slider example using websockets
64c3a5b
send/receive over websocket touches session preventing expiry
9efdaf3
Merge branch 'master' into websockets
e34adad
Merge branch 'master' into websockets
f305106
Correct baseline for websockets
944f3e1
just some code style corrections
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
20 changes: 20 additions & 0 deletions
20
...sitory/BaselineOfSeaside3.package/BaselineOfSeaside3.class/instance/baselinewebsocket..st
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,20 @@ | ||
baselines | ||
baselinewebsocket: spec | ||
|
||
spec for: #'pharo' do: [ | ||
spec blessing: #baseline. | ||
spec | ||
package: 'Seaside-WebSocket-Core' with: [ | ||
spec requires: #('Javascript-Core' 'Seaside-Canvas' ) ]; | ||
" package: 'Seaside-WebSocket-Tests-Core' with: [ | ||
spec requires: #('Javascript-Tests-Core' 'Seaside-WebSocket-Core' ) ];" | ||
package: 'Seaside-WebSocket-Zinc' with:[ | ||
spec requires: #('Zinc' 'Zinc WebSockets') ]; | ||
package: 'Seaside-WebSocket-Examples' with: [ | ||
spec requires: #('JQuery-Core' 'Seaside-WebSocket-Core') ]. | ||
|
||
spec | ||
group: 'WebSocket' with: #('Seaside-WebSocket-Core' 'Seaside-WebSocket-Zinc'); | ||
" group: 'WebSocket Tests' with: #('Seaside-WebSocket-Tests-Core' );" | ||
group: 'Examples' with: #('Seaside-WebSocket-Examples' ) | ||
"group: 'Tests' with: #('WebSocket Tests')" ] |
2 changes: 1 addition & 1 deletion
2
repository/Seaside-Core.package/WARequestHandler.class/instance/handleFiltered..st
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
handling | ||
handleFiltered: aRequestContext | ||
"Handle aRequestContext by either dispatching to a different request handler of by producing a response and singalling the result." | ||
"Handle aRequestContext by either dispatching to a different request handler of by producing a response and signalling the result." | ||
|
||
self subclassResponsibility |
2 changes: 1 addition & 1 deletion
2
repository/Seaside-Tests-Pharo-Core.package/WAFileLibraryTest.extension/instance/runCase.st
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
*Seaside-Tests-Pharo-Core | ||
runCase | ||
GRPlatform current doSilently: [ super performTest ] | ||
GRPlatform current doSilently: [ super runCase ] |
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,5 @@ | ||
{ | ||
"separateMethodMetaAndSource" : false, | ||
"noMethodMetaData" : true, | ||
"useCypressPropertiesFile" : true | ||
} |
Empty file.
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/class/headerField.st
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,3 @@ | ||
configuration | ||
headerField | ||
^ '_ws' |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/close.st
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,3 @@ | ||
initialize-release | ||
close | ||
self call: 'close' |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/defaultUrl.st
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,5 @@ | ||
printing | ||
defaultUrl | ||
^ self renderContext actionUrl | ||
addField: self class headerField | ||
value: self pusher id |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/filter.st
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,5 @@ | ||
accessing | ||
filter | ||
^ self session filters | ||
detect: [ :each | each isWebSocketFilter ] | ||
ifNone: [ self session addFilterFirst: WAWebSocketFilter new ] |
8 changes: 8 additions & 0 deletions
8
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/javascriptContentOn..st
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,8 @@ | ||
printing | ||
javascriptContentOn: aStream | ||
"TODO: window.location should not be retrieved here..." | ||
aStream | ||
nextPutAll: 'new WebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + '; | ||
javascript: self url; | ||
nextPut: $). | ||
pusher ifNotNil:[ pusher websocketEventHandlerJavaScriptOn: aStream ] |
7 changes: 7 additions & 0 deletions
7
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/pusher..st
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,7 @@ | ||
accessing | ||
pusher: aPusher | ||
self url: (self renderContext actionUrl | ||
withField: self class headerField | ||
value: (self filter | ||
registerPusher: (pusher := aPusher) | ||
context: self requestContext)) |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/pusher.st
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,3 @@ | ||
accessing | ||
pusher | ||
^ pusher |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/send..st
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,3 @@ | ||
initialize-release | ||
send: anObject | ||
self call: 'send' with: anObject |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/url..st
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,3 @@ | ||
accessing | ||
url: aUrl | ||
url := aUrl |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/instance/url.st
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,3 @@ | ||
printing | ||
url | ||
^ url ifNil: [ url := self defaultUrl ] |
14 changes: 14 additions & 0 deletions
14
repository/Seaside-WebSocket-Core.package/JSWebSocket.class/properties.json
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,14 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "JSObject", | ||
"category" : "Seaside-WebSocket-Core", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"pusher", | ||
"url" | ||
], | ||
"name" : "JSWebSocket", | ||
"type" : "normal" | ||
} |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/WARenderer.extension/instance/websocket.st
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,5 @@ | ||
*Seaside-WebSocket-Core | ||
websocket | ||
^ (JSWebSocket context: self context) | ||
rendererClass: self species; | ||
yourself |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WARenderer.extension/properties.json
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,3 @@ | ||
{ | ||
"name" : "WARenderer" | ||
} |
9 changes: 9 additions & 0 deletions
9
...ry/Seaside-WebSocket-Core.package/WARequest.extension/instance/isWebSocketSetupRequest.st
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,9 @@ | ||
*Seaside-WebSocket-Core | ||
isWebSocketSetupRequest | ||
"Return true when request can be considered a valid WebSocket setup request" | ||
|
||
^ self isGet | ||
and: [ (self headerAt: 'upgrade' ifAbsent: [ ^ false ]) asLowercase = 'websocket' | ||
and: [ (self headerAt: 'connection' ifAbsent: [ ^ false ]) asLowercase = 'upgrade' | ||
and: [ (self headerAt: 'sec-websocket-version' ifAbsent: [ ^ false ]) = '13' | ||
and: [ self headers includesKey: 'sec-websocket-key' ] ] ] ] |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WARequest.extension/properties.json
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,3 @@ | ||
{ | ||
"name" : "WARequest" | ||
} |
4 changes: 4 additions & 0 deletions
4
...ory/Seaside-WebSocket-Core.package/WARequestContext.extension/instance/createWebSocket.st
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,4 @@ | ||
*seaside-websocket-core | ||
createWebSocket | ||
self webSocket ifNotNil:[ Error signal: 'WAWebSocket already created' ]. | ||
^ self properties at: #webSocket put: (self webSocketCreator newWebSocketInRequestContext: self) |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WARequestContext.extension/instance/webSocket.st
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,3 @@ | ||
*seaside-websocket-core | ||
webSocket | ||
^ self properties at: #webSocket ifAbsent:[ nil ] |
3 changes: 3 additions & 0 deletions
3
...y/Seaside-WebSocket-Core.package/WARequestContext.extension/instance/webSocketCreator..st
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,3 @@ | ||
*seaside-websocket-core | ||
webSocketCreator: aWebSocketCreator | ||
self properties at: #webSocketCreator put: aWebSocketCreator |
3 changes: 3 additions & 0 deletions
3
...ry/Seaside-WebSocket-Core.package/WARequestContext.extension/instance/webSocketCreator.st
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,3 @@ | ||
*seaside-websocket-core | ||
webSocketCreator | ||
^ self properties at: #webSocketCreator |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WARequestContext.extension/properties.json
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,3 @@ | ||
{ | ||
"name" : "WARequestContext" | ||
} |
3 changes: 3 additions & 0 deletions
3
...ry/Seaside-WebSocket-Core.package/WARequestFilter.extension/instance/isWebSocketFilter.st
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,3 @@ | ||
*Seaside-WebSocket-Core | ||
isWebSocketFilter | ||
^ false |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WARequestFilter.extension/properties.json
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,3 @@ | ||
{ | ||
"name" : "WARequestFilter" | ||
} |
1 change: 1 addition & 0 deletions
1
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/README.md
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 @@ | ||
I am a WebSocket. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More an abstract class with server specific implementations. |
5 changes: 5 additions & 0 deletions
5
...easide-WebSocket-Core.package/WAWebSocket.class/instance/initializeWithRequestContext..st
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,5 @@ | ||
initialization | ||
initializeWithRequestContext: aRequestContext | ||
|
||
self initialize. | ||
session := aRequestContext session. |
4 changes: 4 additions & 0 deletions
4
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/isConnected.st
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,4 @@ | ||
testing | ||
isConnected | ||
|
||
self subclassResponsibility |
4 changes: 4 additions & 0 deletions
4
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/onClose..st
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,4 @@ | ||
callbacks | ||
onClose: aBlock | ||
|
||
onClose := aBlock |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/onError..st
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,5 @@ | ||
callbacks | ||
onError: aOneArgumentBlock | ||
|
||
onError := aOneArgumentBlock | ||
|
4 changes: 4 additions & 0 deletions
4
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/onMessage..st
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,4 @@ | ||
callbacks | ||
onMessage: aOneArgumentBlock | ||
|
||
onMessage := aOneArgumentBlock |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/run.st
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,5 @@ | ||
running | ||
run | ||
"Run the WebSocket's input process." | ||
|
||
self subclassResponsibility |
5 changes: 5 additions & 0 deletions
5
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/send..st
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,5 @@ | ||
callbacks | ||
send: aString | ||
"Write data to the socket" | ||
|
||
self subclassResponsibility |
4 changes: 4 additions & 0 deletions
4
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/timeout..st
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,4 @@ | ||
callbacks | ||
timeout: seconds | ||
"Sets the underlying stream timeout." | ||
self subclassResponsibility |
7 changes: 7 additions & 0 deletions
7
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/instance/touchSession.st
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,7 @@ | ||
private | ||
touchSession | ||
"Prevent session expiry." | ||
|
||
session ifNotNil: [ :s | | ||
Transcript show:'Touch session ', s key;cr. | ||
s application cache at: s key ifAbsent:[ ] ] |
16 changes: 16 additions & 0 deletions
16
repository/Seaside-WebSocket-Core.package/WAWebSocket.class/properties.json
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,16 @@ | ||
{ | ||
"commentStamp" : "<historical>", | ||
"super" : "WAObject", | ||
"category" : "Seaside-WebSocket-Core", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"session", | ||
"onMessage", | ||
"onClose", | ||
"onError" | ||
], | ||
"name" : "WAWebSocket", | ||
"type" : "normal" | ||
} |
1 change: 1 addition & 0 deletions
1
repository/Seaside-WebSocket-Core.package/WAWebSocketCreator.class/README.md
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 @@ | ||
I create new instances of WebSocket. I abstract away the server specific ways to create new WebSockets. |
3 changes: 3 additions & 0 deletions
3
...WebSocket-Core.package/WAWebSocketCreator.class/instance/newWebSocketInRequestContext..st
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,3 @@ | ||
instance creation | ||
newWebSocketInRequestContext: aRequestContext | ||
^ self socketClass basicNew initializeWithRequestContext: aRequestContext |
3 changes: 3 additions & 0 deletions
3
repository/Seaside-WebSocket-Core.package/WAWebSocketCreator.class/instance/socketClass.st
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,3 @@ | ||
instance creation | ||
socketClass | ||
self subclassResponsibility |
11 changes: 11 additions & 0 deletions
11
repository/Seaside-WebSocket-Core.package/WAWebSocketCreator.class/properties.json
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,11 @@ | ||
{ | ||
"commentStamp" : "<historical>", | ||
"super" : "WAObject", | ||
"category" : "Seaside-WebSocket-Core", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ ], | ||
"name" : "WAWebSocketCreator", | ||
"type" : "normal" | ||
} |
Empty file.
10 changes: 10 additions & 0 deletions
10
...ide-WebSocket-Core.package/WAWebSocketFilter.class/instance/createWebSocketForContext..st
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,10 @@ | ||
processing | ||
createWebSocketForContext: aRequestContext | ||
| webSocket | | ||
webSocket := aRequestContext createWebSocket. | ||
(pushers | ||
at: (aRequestContext request fields | ||
at: JSWebSocket headerField | ||
ifAbsent: [ ^ nil ])) | ||
addSocket: webSocket. | ||
|
7 changes: 7 additions & 0 deletions
7
...sitory/Seaside-WebSocket-Core.package/WAWebSocketFilter.class/instance/handleFiltered..st
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,7 @@ | ||
processing | ||
handleFiltered: aRequestContext | ||
(aRequestContext request isWebSocketSetupRequest) | ||
ifFalse: [ ^ super handleFiltered: aRequestContext ]. | ||
|
||
self createWebSocketForContext: aRequestContext. | ||
|
4 changes: 4 additions & 0 deletions
4
repository/Seaside-WebSocket-Core.package/WAWebSocketFilter.class/instance/initialize.st
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,4 @@ | ||
initialization | ||
initialize | ||
super initialize. | ||
pushers := Dictionary new |
3 changes: 3 additions & 0 deletions
3
...tory/Seaside-WebSocket-Core.package/WAWebSocketFilter.class/instance/isWebSocketFilter.st
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,3 @@ | ||
testing | ||
isWebSocketFilter | ||
^ true |
4 changes: 4 additions & 0 deletions
4
...easide-WebSocket-Core.package/WAWebSocketFilter.class/instance/registerPusher.context..st
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,4 @@ | ||
public | ||
registerPusher: aPusher context: aContext | ||
pushers at: aPusher id put: aPusher. | ||
^ aPusher id |
13 changes: 13 additions & 0 deletions
13
repository/Seaside-WebSocket-Core.package/WAWebSocketFilter.class/properties.json
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,13 @@ | ||
{ | ||
"commentStamp" : "", | ||
"super" : "WARequestFilter", | ||
"category" : "Seaside-WebSocket-Core", | ||
"classinstvars" : [ ], | ||
"pools" : [ ], | ||
"classvars" : [ ], | ||
"instvars" : [ | ||
"pushers" | ||
], | ||
"name" : "WAWebSocketFilter", | ||
"type" : "normal" | ||
} |
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use
#baseUrl
or something similar here instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. It should probably use the settings of WARequestHandlingConfiguration... it's just that I do not prefer that way of working. Alas, I see no alternative either.