├── .gitignore ├── LICENSE ├── README.md ├── android-app ├── AndroidManifest.xml ├── libs │ └── android-support-v4.jar ├── lint.xml ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── layout │ │ └── activity_mobile_chat.xml │ ├── menu │ │ └── main.xml │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml └── src │ ├── com │ └── codebutler │ │ └── android_websockets │ │ ├── HybiParser.java │ │ └── WebSocketClient.java │ └── nl │ └── meta │ └── mobile │ └── chat │ └── MobileChatActivity.java ├── ios-app └── Mobile Chat │ ├── Mobile Chat.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Mobile Chat │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Default-568h@2x.png │ ├── Default.png │ ├── Default@2x.png │ ├── Mobile Chat-Info.plist │ ├── Mobile Chat-Prefix.pch │ ├── ViewController.h │ ├── ViewController.m │ ├── en.lproj │ │ ├── InfoPlist.strings │ │ ├── MainStoryboard_iPad.storyboard │ │ └── MainStoryboard_iPhone.storyboard │ └── main.m │ └── SocketRocket-master │ ├── .gitignore │ ├── .gitmodules │ ├── LICENSE │ ├── README.rst │ ├── SocketRocket.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── WorkspaceSettings.xcsettings │ └── xcshareddata │ │ └── xcschemes │ │ ├── SocketRocket.xcscheme │ │ ├── SocketRocketOSX.xcscheme │ │ ├── SocketRocketTests.xcscheme │ │ └── TestChat.xcscheme │ └── SocketRocket │ ├── NSData+SRB64Additions.h │ ├── NSData+SRB64Additions.m │ ├── SRWebSocket.h │ ├── SRWebSocket.m │ ├── SocketRocket-Prefix.pch │ ├── base64.c │ └── base64.h ├── nodejs-server └── mobile-chat.js ├── webclient ├── box.css ├── index.html └── mobile-chat.js └── windows-phone-8 └── MobileChat ├── MobileChat.sln └── MobileChat ├── App.xaml ├── App.xaml.cs ├── Assets ├── AlignmentGrid.png ├── ApplicationIcon.png └── Tiles │ ├── FlipCycleTileLarge.png │ ├── FlipCycleTileMedium.png │ ├── FlipCycleTileSmall.png │ ├── IconicTileMediumLarge.png │ └── IconicTileSmall.png ├── LocalizedStrings.cs ├── MobileChat.csproj ├── MobileChat.xaml ├── MobileChat.xaml.cs ├── Properties ├── AppManifest.xml ├── AssemblyInfo.cs └── WMAppManifest.xml ├── Resources ├── AppResources.Designer.cs └── AppResources.resx └── libs └── WebSocket4Net.dll /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Intellij project files 26 | *.iml 27 | *.ipr 28 | *.iws 29 | .idea/ 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web 2 | ============== 3 | 4 | Cross platform (Android, iOS, Windows Phone 8, web) chat supported by NodeJS websockets. 5 | 6 | Quick install 7 | ============== 8 | 9 | Server: 10 | Install Node.js http://nodejs.org/ with SockJS https://github.com/sockjs/sockjs-node on your server. Then run the mobile-chat.js in nodejs-server with the command node mobile-chat.js. 11 | 12 | Webclient: 13 | Make all files available through an installed webserver, for example xampp. 14 | Remember to update the following line for your server. 15 | 16 | For the Webclient change: mobile-chat.js 17 | ```javascript 18 | //Connect to your server here 19 | var mobileChatSocket = new SockJS('http://your.server:6975/mobilechat'); 20 | ``` 21 | 22 | For Android change: MobileChatActivity.java 23 | ```java 24 | // This library requires a raw websocket url. 25 | // For NodeJS with SockJS this should be 26 | // "ws://YOUR.URL:PORT/IDENTIFIER/websocket" 27 | private final String CONSTANT_WEBSOCKETS_URL = "ws://your.site.nl:6975/mobilechat/websocket"; 28 | ``` 29 | 30 | For iOS change: ViewController.m 31 | ```objective-c 32 | //This library requires a raw websocket url. It does accept http instead of ws. 33 | //For NodeJS with SockJS this should be "http://YOUR.URL:PORT/IDENTIFIER/websocket" 34 | self.sockjsSocket = [[SRWebSocket alloc] initWithURL:[[NSURL alloc] initWithString:@"http://your.site:6975/mobilechat/websocket"]]; 35 | ``` 36 | 37 | For Windows Phone 8 change: MobileChat.xaml.cs 38 | ```c# 39 | //This library requires a raw websocket url. 40 | //For NodeJS with SockJS this should be "ws://YOUR.URL:PORT/IDENTIFIER/websocket" 41 | private readonly String webSocketLink = "ws://your.site:6975/mobilechat/websocket"; 42 | ``` 43 | 44 | Libraries used 45 | ============== 46 | * Web: SockJS 47 | * Android : Codebutler 48 | * IOS: SocketRocket 49 | * Windows phone 8: WebSocket4Net 50 | -------------------------------------------------------------------------------- /android-app/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | 12 | 13 | 14 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /android-app/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/android-app/libs/android-support-v4.jar -------------------------------------------------------------------------------- /android-app/lint.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /android-app/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /android-app/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-18 15 | -------------------------------------------------------------------------------- /android-app/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/android-app/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android-app/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/android-app/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android-app/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/android-app/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android-app/res/layout/activity_mobile_chat.xml: -------------------------------------------------------------------------------- 1 | 21 | 22 | 31 | 32 | 40 | 41 | 49 | 50 | 51 | 52 | 53 | 62 | 63 | 68 | 69 | 70 | 71 | 72 | 73 | 81 | 82 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/Mobile Chat/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Mobile Chat 4 | /* 5 | Mobile Chat (ff-mobile-chat) is a cross platform 6 | (Android, iOS, Windows Phone 8, web) chat supported by NodeJS websockets. 7 | 8 | 9 | Copyright (C) 2013-2014 Terry Wahl & Marco Jacobs 10 | 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU Affero General Public License as 13 | published by the Free Software Foundation, either version 3 of the 14 | License, or (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU Affero General Public License for more details. 20 | 21 | You should have received a copy of the GNU Affero General Public License 22 | along with this program. If not, see . 23 | */ 24 | 25 | #import 26 | 27 | #import "AppDelegate.h" 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | @autoreleasepool { 32 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .env/ 3 | *.egg-info 4 | reports/ 5 | build/ 6 | nohup.out 7 | .DS_Store 8 | xcuserdata/ 9 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pages"] 2 | path = pages 3 | url = git://github.com/square/SocketRocket.git 4 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright 2012 Square Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/README.rst: -------------------------------------------------------------------------------- 1 | SocketRocket Objective-C WebSocket Client (beta) 2 | ================================================ 3 | A conforming WebSocket (`RFC 6455 `_) 4 | client library. 5 | 6 | `Test results for SocketRocket here `_. 7 | You can compare to what `modern browsers look like here 8 | `_. 9 | 10 | SocketRocket currently conforms to all ~300 of `Autobahn 11 | `_'s fuzzing tests (aside from 12 | two UTF-8 ones where it is merely *non-strict*. tests 6.4.2 and 6.4.4) 13 | 14 | Features/Design 15 | --------------- 16 | - TLS (wss) support. It uses CFStream so we get this for *free* 17 | - Uses NSStream/CFNetworking. Earlier implementations used ``dispatch_io``, 18 | however, this proved to be make TLS nearly impossible. Also I wanted this to 19 | work in iOS 4.x. (SocketRocket only supports 5.0 and above now) 20 | - Uses ARC. It uses the 4.0 compatible subset (no weak refs). 21 | - Seems to perform quite well 22 | - Parallel architecture. Most of the work is done in background worker queues. 23 | - Delegate-based. Had older versions that could use blocks too, but I felt it 24 | didn't blend well with retain cycles and just objective C in general. 25 | 26 | Changes 27 | ------- 28 | 29 | v0.3.1-beta2 - 2013-01-12 30 | ````````````````````````` 31 | 32 | - Stability fix for ``closeWithCode:reason:`` (Thanks @michaelpetrov!) 33 | - Actually clean up the NSStreams and remove them from their runloops 34 | - ``_SRRunLoopThread``'s ``main`` wasn't correctly wrapped with 35 | ``@autoreleasepool`` 36 | 37 | v0.3.1-beta1 - 2013-01-12 38 | ````````````````````````` 39 | 40 | - Cleaned up GCD so OS_OBJECT_USE_OBJC_RETAIN_RELEASE is optional 41 | - Removed deprecated ``dispatch_get_current_queue`` in favor of ``dispatch_queue_set_specific`` and ``dispatch_get_specific`` 42 | - Dropping support for iOS 4.0 (it may still work) 43 | 44 | 45 | Installing (iOS) 46 | ---------------- 47 | There's a few options. Choose one, or just figure it out 48 | 49 | - You can copy all the files in the SocketRocket group into your app. 50 | - Include SocketRocket as a subproject and use libSocketRocket 51 | 52 | If you do this, you must add -ObjC to your "other linker flags" option 53 | 54 | - For OS X you will have to repackage make a .framework target. I will take 55 | contributions. Message me if you are interested. 56 | 57 | 58 | Depending on how you configure your project you may need to ``#import`` either 59 | ```` or ``"SRSocketRocket.h"`` 60 | 61 | Framework Dependencies 62 | `````````````````````` 63 | Your .app must be linked against the following frameworks/dylibs 64 | 65 | - libicucore.dylib 66 | - CFNetwork.framework 67 | - Security.framework 68 | - Foundation.framework 69 | 70 | Installing (OS X) 71 | ----------------- 72 | SocketRocket now has (64-bit only) OS X support. ``SocketRocket.framework`` 73 | inside Xcode project is for OS X only. It should be identical in function aside 74 | from the unicode validation. ICU isn't shipped with OS X which is what the 75 | original implementation used for unicode validation. The workaround is much 76 | more rhudimentary and less robust. 77 | 78 | 1. Add SocketRocket.xcodeproj as either a subproject of your app or in your workspace. 79 | 2. Add ``SocketRocket.framework`` to the link libraries 80 | 3. If you don't have a "copy files" step for ``Framework``, create one 81 | 4. Add ``SocketRocket.framework`` to the "copy files" step. 82 | 83 | API 84 | --- 85 | The classes 86 | 87 | ``SRWebSocket`` 88 | ``````````````` 89 | The Web Socket. 90 | 91 | .. note:: ``SRWebSocket`` will retain itself between ``-(void)open`` and when it 92 | closes, errors, or fails. This is similar to how ``NSURLConnection`` behaves. 93 | (unlike ``NSURLConnection``, ``SRWebSocket`` won't retain the delegate) 94 | 95 | What you need to know 96 | 97 | .. code-block:: objective-c 98 | 99 | @interface SRWebSocket : NSObject 100 | 101 | // Make it with this 102 | - (id)initWithURLRequest:(NSURLRequest *)request; 103 | 104 | // Set this before opening 105 | @property (nonatomic, assign) id delegate; 106 | 107 | - (void)open; 108 | 109 | // Close it with this 110 | - (void)close; 111 | 112 | // Send a UTF8 String or Data 113 | - (void)send:(id)data; 114 | 115 | @end 116 | 117 | ``SRWebSocketDelegate`` 118 | ``````````````````````` 119 | You implement this 120 | 121 | .. code-block:: objective-c 122 | 123 | @protocol SRWebSocketDelegate 124 | 125 | - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message; 126 | 127 | @optional 128 | 129 | - (void)webSocketDidOpen:(SRWebSocket *)webSocket; 130 | - (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error; 131 | - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; 132 | 133 | @end 134 | 135 | Known Issues/Server Todo's 136 | -------------------------- 137 | - Needs auth delegates (like in NSURLConnection) 138 | - Move the streams off the main runloop (most of the work is backgrounded uses 139 | GCD, but I just haven't gotten around to moving it off the main loop since I 140 | converted it from dispatch_io) 141 | - Re-implement server. I removed an existing implementation as well because it 142 | wasn't being used and I wasn't super happy with the interface. Will revisit 143 | this. 144 | - Separate framer and client logic. This will make it nicer when having a 145 | server. 146 | 147 | Testing 148 | ------- 149 | Included are setup scripts for the python testing environment. It comes 150 | packaged with vitualenv so all the dependencies are installed in userland. 151 | 152 | To run the short test from the command line, run:: 153 | 154 | make test 155 | 156 | To run all the tests, run:: 157 | 158 | make test_all 159 | 160 | The short tests don't include the performance tests. (the test harness is 161 | actually the bottleneck, not SocketRocket). 162 | 163 | The first time this is run, it may take a while to install the dependencies. It 164 | will be smooth sailing after that. After the test runs the makefile will open 165 | the results page in your browser. If nothing comes up, you failed. Working on 166 | making this interface a bit nicer. 167 | 168 | To run from the app, choose the ``SocketRocket`` target and run the test action 169 | (``cmd+u``). It runs the same thing, but makes it easier to debug. There is 170 | some serious pre/post hooks in the Test action. You can edit it to customize 171 | behavior. 172 | 173 | .. note:: Xcode only up to version 4.4 is currently supported for the test 174 | harness 175 | 176 | TestChat Demo Application 177 | ------------------------- 178 | SocketRocket includes a demo app, TestChat. It will "chat" with a listening 179 | websocket on port 9900. 180 | 181 | It's a simple project. Uses storyboard. Storyboard is sweet. 182 | 183 | 184 | TestChat Server 185 | ``````````````` 186 | We've included a small server for the chat app. It has a simple function. 187 | It will take a message and broadcast it to all other connected clients. 188 | 189 | We have to get some dependencies. We also want to reuse the virtualenv we made 190 | when we ran the tests. If you haven't run the tests yet, go into the 191 | SocketRocket root directory and type:: 192 | 193 | make test 194 | 195 | This will set up your `virtualenv `_. 196 | Now, in your terminal:: 197 | 198 | source .env/bin/activate 199 | pip install git+https://github.com/facebook/tornado.git 200 | 201 | In the same terminal session, start the chatroom server:: 202 | 203 | python TestChatServer/py/chatroom.py 204 | 205 | There's also a Go implementation (with the latest weekly) where you can:: 206 | 207 | cd TestChatServer/go 208 | go run chatroom.go 209 | 210 | Chatting 211 | ```````` 212 | Now, start TestChat.app (just run the target in the XCode project). If you had 213 | it started already you can hit the refresh button to reconnect. It should say 214 | "Connected!" on top. 215 | 216 | To talk with the app, open up your browser to `http://localhost:9000 `_ and 217 | start chatting. 218 | 219 | 220 | WebSocket Server Implementation Recommendations 221 | ----------------------------------------------- 222 | SocketRocket has been used with the following libraries: 223 | 224 | - `Tornado `_ 225 | - Go's `weekly build `_ (the official release has an 226 | outdated protocol, so you may have to use weekly until `Go 1 227 | `_ is released) 228 | - `Autobahn `_ (using its fuzzing 229 | client) 230 | 231 | The Tornado one is dirt simple and works like a charm. (`IPython notebook 232 | `_ uses it 233 | too). It's much easier to configure handlers and routes than in 234 | Autobahn/twisted. 235 | 236 | As far as Go's goes, it works in my limited testing. I much prefer go's 237 | concurrency model as well. Try it! You may like it. 238 | It could use some more control over things such as pings, etc., but I 239 | am sure it will come in time. 240 | 241 | Autobahn is a great test suite. The Python server code is good, and conforms 242 | well (obviously). Hovever, for me, twisted would be a deal-breaker for writing 243 | something new. I find it a bit too complex and heavy for a simple service. If 244 | you are already using twisted though, Autobahn is probably for you. 245 | 246 | Contributing 247 | ------------ 248 | Any contributors to the master SocketRocket repository must sign the `Individual 249 | Contributor License Agreement 250 | (CLA) 251 | `_. 252 | It's a short form that covers our bases and makes sure you're eligible to 253 | contribute. 254 | 255 | When you have a change you'd like to see in the master repository, `send a pull 256 | request `_. Before we merge your 257 | request, we'll make sure you're in the list of people who have signed a CLA. 258 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/xcshareddata/xcschemes/SocketRocket.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 66 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 85 | 91 | 92 | 93 | 94 | 95 | 101 | 102 | 103 | 104 | 108 | 109 | 110 | 111 | 120 | 121 | 125 | 126 | 130 | 131 | 135 | 136 | 140 | 141 | 142 | 143 | 149 | 150 | 152 | 153 | 156 | 157 | 158 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/xcshareddata/xcschemes/SocketRocketOSX.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 42 | 43 | 44 | 45 | 51 | 52 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/xcshareddata/xcschemes/SocketRocketTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 52 | 53 | 57 | 58 | 62 | 63 | 67 | 68 | 72 | 73 | 74 | 75 | 81 | 82 | 84 | 85 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket.xcodeproj/xcshareddata/xcschemes/TestChat.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 65 | 66 | 70 | 71 | 75 | 76 | 80 | 81 | 82 | 83 | 89 | 90 | 96 | 97 | 98 | 99 | 101 | 102 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/NSData+SRB64Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Square Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | 19 | 20 | @interface NSData (SRB64Additions) 21 | 22 | - (NSString *)SR_stringByBase64Encoding; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/NSData+SRB64Additions.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Square Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import "NSData+SRB64Additions.h" 18 | #import "base64.h" 19 | 20 | 21 | @implementation NSData (SRB64Additions) 22 | 23 | - (NSString *)SR_stringByBase64Encoding; 24 | { 25 | size_t buffer_size = (([self length] * 3 + 2) / 2); 26 | 27 | char *buffer = (char *)malloc(buffer_size); 28 | 29 | int len = b64_ntop([self bytes], [self length], buffer, buffer_size); 30 | 31 | if (len == -1) { 32 | free(buffer); 33 | return nil; 34 | } else{ 35 | return [[NSString alloc] initWithBytesNoCopy:buffer length:len encoding:NSUTF8StringEncoding freeWhenDone:YES]; 36 | } 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/SRWebSocket.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Square Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #import 18 | #import 19 | 20 | typedef enum { 21 | SR_CONNECTING = 0, 22 | SR_OPEN = 1, 23 | SR_CLOSING = 2, 24 | SR_CLOSED = 3, 25 | } SRReadyState; 26 | 27 | @class SRWebSocket; 28 | 29 | extern NSString *const SRWebSocketErrorDomain; 30 | 31 | #pragma mark - SRWebSocketDelegate 32 | 33 | @protocol SRWebSocketDelegate; 34 | 35 | #pragma mark - SRWebSocket 36 | 37 | @interface SRWebSocket : NSObject 38 | 39 | @property (nonatomic, assign) id delegate; 40 | 41 | @property (nonatomic, readonly) SRReadyState readyState; 42 | @property (nonatomic, readonly, retain) NSURL *url; 43 | 44 | // This returns the negotiated protocol. 45 | // It will be nil until after the handshake completes. 46 | @property (nonatomic, readonly, copy) NSString *protocol; 47 | 48 | // Protocols should be an array of strings that turn into Sec-WebSocket-Protocol. 49 | - (id)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols; 50 | - (id)initWithURLRequest:(NSURLRequest *)request; 51 | 52 | // Some helper constructors. 53 | - (id)initWithURL:(NSURL *)url protocols:(NSArray *)protocols; 54 | - (id)initWithURL:(NSURL *)url; 55 | 56 | // Delegate queue will be dispatch_main_queue by default. 57 | // You cannot set both OperationQueue and dispatch_queue. 58 | - (void)setDelegateOperationQueue:(NSOperationQueue*) queue; 59 | - (void)setDelegateDispatchQueue:(dispatch_queue_t) queue; 60 | 61 | // By default, it will schedule itself on +[NSRunLoop SR_networkRunLoop] using defaultModes. 62 | - (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; 63 | - (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; 64 | 65 | // SRWebSockets are intended for one-time-use only. Open should be called once and only once. 66 | - (void)open; 67 | 68 | - (void)close; 69 | - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; 70 | 71 | // Send a UTF8 String or Data. 72 | - (void)send:(id)data; 73 | 74 | @end 75 | 76 | #pragma mark - SRWebSocketDelegate 77 | 78 | @protocol SRWebSocketDelegate 79 | 80 | // message will either be an NSString if the server is using text 81 | // or NSData if the server is using binary. 82 | - (void)webSocket:(SRWebSocket *)webSocket didReceiveMessage:(id)message; 83 | 84 | @optional 85 | 86 | - (void)webSocketDidOpen:(SRWebSocket *)webSocket; 87 | - (void)webSocket:(SRWebSocket *)webSocket didFailWithError:(NSError *)error; 88 | - (void)webSocket:(SRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; 89 | 90 | @end 91 | 92 | #pragma mark - NSURLRequest (CertificateAdditions) 93 | 94 | @interface NSURLRequest (CertificateAdditions) 95 | 96 | @property (nonatomic, retain, readonly) NSArray *SR_SSLPinnedCertificates; 97 | 98 | @end 99 | 100 | #pragma mark - NSMutableURLRequest (CertificateAdditions) 101 | 102 | @interface NSMutableURLRequest (CertificateAdditions) 103 | 104 | @property (nonatomic, retain) NSArray *SR_SSLPinnedCertificates; 105 | 106 | @end 107 | 108 | #pragma mark - NSRunLoop (SRWebSocket) 109 | 110 | @interface NSRunLoop (SRWebSocket) 111 | 112 | + (NSRunLoop *)SR_networkRunLoop; 113 | 114 | @end 115 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/SocketRocket-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright 2012 Square Inc. 3 | // 4 | // Licensed under the Apache License, Version 2.0 (the "License"); 5 | // you may not use this file except in compliance with the License. 6 | // You may obtain a copy of the License at 7 | // 8 | // http://www.apache.org/licenses/LICENSE-2.0 9 | // 10 | // Unless required by applicable law or agreed to in writing, software 11 | // distributed under the License is distributed on an "AS IS" BASIS, 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | // See the License for the specific language governing permissions and 14 | // limitations under the License. 15 | // 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifdef __OBJC__ 22 | #import 23 | #endif 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/base64.c: -------------------------------------------------------------------------------- 1 | /* $OpenBSD: base64.c,v 1.5 2006/10/21 09:55:03 otto Exp $ */ 2 | 3 | /* 4 | * Copyright (c) 1996 by Internet Software Consortium. 5 | * 6 | * Permission to use, copy, modify, and distribute this software for any 7 | * purpose with or without fee is hereby granted, provided that the above 8 | * copyright notice and this permission notice appear in all copies. 9 | * 10 | * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS 11 | * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 12 | * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE 13 | * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 16 | * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 17 | * SOFTWARE. 18 | */ 19 | 20 | /* 21 | * Portions Copyright (c) 1995 by International Business Machines, Inc. 22 | * 23 | * International Business Machines, Inc. (hereinafter called IBM) grants 24 | * permission under its copyrights to use, copy, modify, and distribute this 25 | * Software with or without fee, provided that the above copyright notice and 26 | * all paragraphs of this notice appear in all copies, and that the name of IBM 27 | * not be used in connection with the marketing of any product incorporating 28 | * the Software or modifications thereof, without specific, written prior 29 | * permission. 30 | * 31 | * To the extent it has a right to do so, IBM grants an immunity from suit 32 | * under its patents, if any, for the use, sale or manufacture of products to 33 | * the extent that such products are used for performing Domain Name System 34 | * dynamic updates in TCP/IP networks by means of the Software. No immunity is 35 | * granted for any product per se or for any other function of any product. 36 | * 37 | * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, 38 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 39 | * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, 40 | * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING 41 | * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN 42 | * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. 43 | */ 44 | 45 | /* OPENBSD ORIGINAL: lib/libc/net/base64.c */ 46 | 47 | 48 | #if (!defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)) || (!defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON)) 49 | 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | 56 | #include 57 | #include 58 | 59 | #include 60 | #include 61 | 62 | #include "base64.h" 63 | 64 | static const char Base64[] = 65 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 66 | static const char Pad64 = '='; 67 | 68 | /* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) 69 | The following encoding technique is taken from RFC 1521 by Borenstein 70 | and Freed. It is reproduced here in a slightly edited form for 71 | convenience. 72 | 73 | A 65-character subset of US-ASCII is used, enabling 6 bits to be 74 | represented per printable character. (The extra 65th character, "=", 75 | is used to signify a special processing function.) 76 | 77 | The encoding process represents 24-bit groups of input bits as output 78 | strings of 4 encoded characters. Proceeding from left to right, a 79 | 24-bit input group is formed by concatenating 3 8-bit input groups. 80 | These 24 bits are then treated as 4 concatenated 6-bit groups, each 81 | of which is translated into a single digit in the base64 alphabet. 82 | 83 | Each 6-bit group is used as an index into an array of 64 printable 84 | characters. The character referenced by the index is placed in the 85 | output string. 86 | 87 | Table 1: The Base64 Alphabet 88 | 89 | Value Encoding Value Encoding Value Encoding Value Encoding 90 | 0 A 17 R 34 i 51 z 91 | 1 B 18 S 35 j 52 0 92 | 2 C 19 T 36 k 53 1 93 | 3 D 20 U 37 l 54 2 94 | 4 E 21 V 38 m 55 3 95 | 5 F 22 W 39 n 56 4 96 | 6 G 23 X 40 o 57 5 97 | 7 H 24 Y 41 p 58 6 98 | 8 I 25 Z 42 q 59 7 99 | 9 J 26 a 43 r 60 8 100 | 10 K 27 b 44 s 61 9 101 | 11 L 28 c 45 t 62 + 102 | 12 M 29 d 46 u 63 / 103 | 13 N 30 e 47 v 104 | 14 O 31 f 48 w (pad) = 105 | 15 P 32 g 49 x 106 | 16 Q 33 h 50 y 107 | 108 | Special processing is performed if fewer than 24 bits are available 109 | at the end of the data being encoded. A full encoding quantum is 110 | always completed at the end of a quantity. When fewer than 24 input 111 | bits are available in an input group, zero bits are added (on the 112 | right) to form an integral number of 6-bit groups. Padding at the 113 | end of the data is performed using the '=' character. 114 | 115 | Since all base64 input is an integral number of octets, only the 116 | ------------------------------------------------- 117 | following cases can arise: 118 | 119 | (1) the final quantum of encoding input is an integral 120 | multiple of 24 bits; here, the final unit of encoded 121 | output will be an integral multiple of 4 characters 122 | with no "=" padding, 123 | (2) the final quantum of encoding input is exactly 8 bits; 124 | here, the final unit of encoded output will be two 125 | characters followed by two "=" padding characters, or 126 | (3) the final quantum of encoding input is exactly 16 bits; 127 | here, the final unit of encoded output will be three 128 | characters followed by one "=" padding character. 129 | */ 130 | 131 | #if !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP) 132 | int 133 | b64_ntop(u_char const *src, size_t srclength, char *target, size_t targsize) 134 | { 135 | size_t datalength = 0; 136 | u_char input[3]; 137 | u_char output[4]; 138 | u_int i; 139 | 140 | while (2 < srclength) { 141 | input[0] = *src++; 142 | input[1] = *src++; 143 | input[2] = *src++; 144 | srclength -= 3; 145 | 146 | output[0] = input[0] >> 2; 147 | output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); 148 | output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); 149 | output[3] = input[2] & 0x3f; 150 | 151 | if (datalength + 4 > targsize) 152 | return (-1); 153 | target[datalength++] = Base64[output[0]]; 154 | target[datalength++] = Base64[output[1]]; 155 | target[datalength++] = Base64[output[2]]; 156 | target[datalength++] = Base64[output[3]]; 157 | } 158 | 159 | /* Now we worry about padding. */ 160 | if (0 != srclength) { 161 | /* Get what's left. */ 162 | input[0] = input[1] = input[2] = '\0'; 163 | for (i = 0; i < srclength; i++) 164 | input[i] = *src++; 165 | 166 | output[0] = input[0] >> 2; 167 | output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); 168 | output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); 169 | 170 | if (datalength + 4 > targsize) 171 | return (-1); 172 | target[datalength++] = Base64[output[0]]; 173 | target[datalength++] = Base64[output[1]]; 174 | if (srclength == 1) 175 | target[datalength++] = Pad64; 176 | else 177 | target[datalength++] = Base64[output[2]]; 178 | target[datalength++] = Pad64; 179 | } 180 | if (datalength >= targsize) 181 | return (-1); 182 | target[datalength] = '\0'; /* Returned value doesn't count \0. */ 183 | return (datalength); 184 | } 185 | #endif /* !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP) */ 186 | 187 | #if !defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON) 188 | 189 | /* skips all whitespace anywhere. 190 | converts characters, four at a time, starting at (or after) 191 | src from base - 64 numbers into three 8 bit bytes in the target area. 192 | it returns the number of data bytes stored at the target, or -1 on error. 193 | */ 194 | 195 | int 196 | b64_pton(char const *src, u_char *target, size_t targsize) 197 | { 198 | u_int tarindex, state; 199 | int ch; 200 | char *pos; 201 | 202 | state = 0; 203 | tarindex = 0; 204 | 205 | while ((ch = *src++) != '\0') { 206 | if (isspace(ch)) /* Skip whitespace anywhere. */ 207 | continue; 208 | 209 | if (ch == Pad64) 210 | break; 211 | 212 | pos = strchr(Base64, ch); 213 | if (pos == 0) /* A non-base64 character. */ 214 | return (-1); 215 | 216 | switch (state) { 217 | case 0: 218 | if (target) { 219 | if (tarindex >= targsize) 220 | return (-1); 221 | target[tarindex] = (pos - Base64) << 2; 222 | } 223 | state = 1; 224 | break; 225 | case 1: 226 | if (target) { 227 | if (tarindex + 1 >= targsize) 228 | return (-1); 229 | target[tarindex] |= (pos - Base64) >> 4; 230 | target[tarindex+1] = ((pos - Base64) & 0x0f) 231 | << 4 ; 232 | } 233 | tarindex++; 234 | state = 2; 235 | break; 236 | case 2: 237 | if (target) { 238 | if (tarindex + 1 >= targsize) 239 | return (-1); 240 | target[tarindex] |= (pos - Base64) >> 2; 241 | target[tarindex+1] = ((pos - Base64) & 0x03) 242 | << 6; 243 | } 244 | tarindex++; 245 | state = 3; 246 | break; 247 | case 3: 248 | if (target) { 249 | if (tarindex >= targsize) 250 | return (-1); 251 | target[tarindex] |= (pos - Base64); 252 | } 253 | tarindex++; 254 | state = 0; 255 | break; 256 | } 257 | } 258 | 259 | /* 260 | * We are done decoding Base-64 chars. Let's see if we ended 261 | * on a byte boundary, and/or with erroneous trailing characters. 262 | */ 263 | 264 | if (ch == Pad64) { /* We got a pad char. */ 265 | ch = *src++; /* Skip it, get next. */ 266 | switch (state) { 267 | case 0: /* Invalid = in first position */ 268 | case 1: /* Invalid = in second position */ 269 | return (-1); 270 | 271 | case 2: /* Valid, means one byte of info */ 272 | /* Skip any number of spaces. */ 273 | for (; ch != '\0'; ch = *src++) 274 | if (!isspace(ch)) 275 | break; 276 | /* Make sure there is another trailing = sign. */ 277 | if (ch != Pad64) 278 | return (-1); 279 | ch = *src++; /* Skip the = */ 280 | /* Fall through to "single trailing =" case. */ 281 | /* FALLTHROUGH */ 282 | 283 | case 3: /* Valid, means two bytes of info */ 284 | /* 285 | * We know this char is an =. Is there anything but 286 | * whitespace after it? 287 | */ 288 | for (; ch != '\0'; ch = *src++) 289 | if (!isspace(ch)) 290 | return (-1); 291 | 292 | /* 293 | * Now make sure for cases 2 and 3 that the "extra" 294 | * bits that slopped past the last full byte were 295 | * zeros. If we don't check them, they become a 296 | * subliminal channel. 297 | */ 298 | if (target && target[tarindex] != 0) 299 | return (-1); 300 | } 301 | } else { 302 | /* 303 | * We ended by seeing the end of the string. Make sure we 304 | * have no partial bytes lying around. 305 | */ 306 | if (state != 0) 307 | return (-1); 308 | } 309 | 310 | return (tarindex); 311 | } 312 | 313 | #endif /* !defined(HAVE_B64_PTON) && !defined(HAVE___B64_PTON) */ 314 | #endif 315 | -------------------------------------------------------------------------------- /ios-app/Mobile Chat/SocketRocket-master/SocketRocket/base64.h: -------------------------------------------------------------------------------- 1 | // Copyright 2012 Square Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | 16 | 17 | #ifndef SocketRocket_base64_h 18 | #define SocketRocket_base64_h 19 | 20 | #include 21 | 22 | extern int 23 | b64_ntop(u_char const *src, 24 | size_t srclength, 25 | char *target, 26 | size_t targsize); 27 | 28 | extern int 29 | b64_pton(char const *src, 30 | u_char *target, 31 | size_t targsize); 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /nodejs-server/mobile-chat.js: -------------------------------------------------------------------------------- 1 | /* 2 | Mobile Chat (ff-mobile-chat) is a cross platform 3 | (Android, iOS, Windows Phone 8, web) chat supported by NodeJS websockets. 4 | 5 | 6 | Copyright (C) 2013-2014 Terry Wahl & Marco Jacobs 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU Affero General Public License as 10 | published by the Free Software Foundation, either version 3 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Affero General Public License for more details. 17 | 18 | You should have received a copy of the GNU Affero General Public License 19 | along with this program. If not, see . 20 | */ 21 | 22 | //vars 23 | var http = require('http'), 24 | sockjs = require('sockjs'), 25 | mobileChat = sockjs.createServer(), 26 | connections = []; 27 | 28 | //configure message relays 29 | mobileChat.on('connection', function (conn) { 30 | console.log('New connection'); 31 | connections.push(conn); 32 | conn.on('data', function (message) { 33 | console.log('New data: ' + message); 34 | // send message to all connections 35 | for (var i = 0; i < connections.length; i++) { 36 | connections[i].write(message); 37 | } 38 | }); 39 | conn.on('close', function () { 40 | connections.splice(connections.indexOf(conn), 1); 41 | console.log('Closed connection'); 42 | }); 43 | }); 44 | 45 | //server loc 46 | var server = http.createServer(); 47 | mobileChat.installHandlers(server, { 48 | prefix: '/mobilechat' 49 | }); 50 | //location is self 51 | server.listen(6975, '0.0.0.0'); -------------------------------------------------------------------------------- /webclient/box.css: -------------------------------------------------------------------------------- 1 | /* 2 | Mobile Chat (ff-mobile-chat) is a cross platform 3 | (Android, iOS, Windows Phone 8, web) chat supported by NodeJS websockets. 4 | 5 | 6 | Copyright (C) 2013-2014 Terry Wahl & Marco Jacobs 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU Affero General Public License as 10 | published by the Free Software Foundation, either version 3 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Affero General Public License for more details. 17 | 18 | You should have received a copy of the GNU Affero General Public License 19 | along with this program. If not, see . 20 | */ 21 | 22 | #signInForm, #messageForm { 23 | margin: 0px; 24 | margin-bottom: 1px; 25 | } 26 | #userName { 27 | width: 150px; 28 | height: 22px; 29 | border: 1px teal solid; 30 | float: left; 31 | } 32 | #changeNameButton { 33 | width: 100px; 34 | height: 22px; 35 | } 36 | #chatBox { 37 | font-family: tahoma; 38 | font-size: 12px; 39 | color: black; 40 | border: 1px teal solid; 41 | height: 225px; 42 | width: 400px; 43 | overflow: scroll; 44 | margin-left: 1px; 45 | } 46 | #message { 47 | width: 350px; 48 | height: 22px; 49 | border: 1px teal solid; 50 | float: left; 51 | margin-left: 1px; 52 | margin-top: 1px; 53 | } 54 | #send { 55 | width: 50px; 56 | height: 22px; 57 | float: left; 58 | margin: 1px; 59 | } 60 | .disconnected { 61 | color: red; 62 | } 63 | .connected { 64 | color: green; 65 | } -------------------------------------------------------------------------------- /webclient/index.html: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 24 | 25 | Mobile Chat 26 | 27 | 28 | 29 | 30 |

Mobile Chat

31 |
32 |

Status: 33 | Disconnected 34 |

35 |
36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 |
44 | 45 | 46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /webclient/mobile-chat.js: -------------------------------------------------------------------------------- 1 | /* 2 | Mobile Chat (ff-mobile-chat) is a cross platform 3 | (Android, iOS, Windows Phone 8, web) chat supported by NodeJS websockets. 4 | 5 | 6 | Copyright (C) 2013-2014 Terry Wahl & Marco Jacobs 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU Affero General Public License as 10 | published by the Free Software Foundation, either version 3 of the 11 | License, or (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU Affero General Public License for more details. 17 | 18 | You should have received a copy of the GNU Affero General Public License 19 | along with this program. If not, see . 20 | */ 21 | 22 | (function () { 23 | var connectToServer = function () { 24 | //Connect to your server here 25 | var mobileChatSocket = new SockJS('http://your.server:6975/mobilechat'); 26 | 27 | mobileChatSocket.onopen = function () { 28 | clearInterval(connectRetry); 29 | $('.connect-status') 30 | .removeClass('disconnected') 31 | .addClass('connected') 32 | .text('Connected'); 33 | }; 34 | 35 | //Receive message from server 36 | mobileChatSocket.onmessage = function (e) { 37 | $('#chatBox').html($('#chatBox').html() + '
' + e.data); 38 | var objDiv = document.getElementById('chatBox'); 39 | objDiv.scrollTop = objDiv.scrollHeight; 40 | }; 41 | 42 | mobileChatSocket.onclose = function () { 43 | clearInterval(connectRetry); 44 | connectRetry = setInterval(connectToServer, 1000); 45 | $('.connect-status') 46 | .removeClass('connected') 47 | .addClass('disconnected') 48 | .text('Disconnected'); 49 | }; 50 | 51 | //Send your message to the server. 52 | $('#sendButton').on('click', function () { 53 | if ($('#userName').val() != '') { 54 | if ($('#messageBox').val() != '') { 55 | mobileChatSocket.send($('#userName').val() + ': ' + $('#messageBox').val()); 56 | document.getElementById("messageBox").value = ''; 57 | } 58 | } else { 59 | $('#chatBox').html($('#chatBox').html() + '
' + 'Please put you name in box above!'); 60 | var objDiv = document.getElementById('chatBox'); 61 | objDiv.scrollTop = objDiv.scrollHeight; 62 | } 63 | }); 64 | 65 | //Prevent enter refreshing the page, it sends the text from now on 66 | $('#messageBox').keydown(function (e) { 67 | if (e.keyCode == 13) { // 13 is enter 68 | if ($('#userName').val() != '') { 69 | if ($('#messageBox').val() != '') { 70 | mobileChatSocket.send($('#userName').val() + ': ' + $('#messageBox').val()); 71 | document.getElementById("messageBox").value = ''; 72 | } 73 | } else { 74 | $('#chatBox').html($('#chatBox').html() + '
' + 'Please put you name in box above!'); 75 | var objDiv = document.getElementById('chatBox'); 76 | objDiv.scrollTop = objDiv.scrollHeight; 77 | } 78 | return false; 79 | } 80 | }); 81 | 82 | //Prevent enter refreshing the page 83 | $('#messageBox').keydown(function (e) { 84 | if (e.keyCode == 13) { // 13 is enter 85 | 86 | return false; 87 | } 88 | }); 89 | }; 90 | 91 | var connectRetry = setInterval(connectToServer, 1000); 92 | })(); -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.21005.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MobileChat", "MobileChat\MobileChat.csproj", "{BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|ARM = Debug|ARM 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|ARM = Release|ARM 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|Any CPU.Deploy.0 = Debug|Any CPU 21 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|ARM.ActiveCfg = Debug|ARM 22 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|ARM.Build.0 = Debug|ARM 23 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|ARM.Deploy.0 = Debug|ARM 24 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|x86.ActiveCfg = Debug|x86 25 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|x86.Build.0 = Debug|x86 26 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Debug|x86.Deploy.0 = Debug|x86 27 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|Any CPU.Deploy.0 = Release|Any CPU 30 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|ARM.ActiveCfg = Release|ARM 31 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|ARM.Build.0 = Release|ARM 32 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|ARM.Deploy.0 = Release|ARM 33 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|x86.ActiveCfg = Release|x86 34 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|x86.Build.0 = Release|x86 35 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6}.Release|x86.Deploy.0 = Release|x86 36 | EndGlobalSection 37 | GlobalSection(SolutionProperties) = preSolution 38 | HideSolutionNode = FALSE 39 | EndGlobalSection 40 | EndGlobal 41 | -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/App.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Resources; 4 | using System.Windows; 5 | using System.Windows.Markup; 6 | using System.Windows.Navigation; 7 | using Microsoft.Phone.Controls; 8 | using Microsoft.Phone.Shell; 9 | using MobileChat.Resources; 10 | 11 | namespace MobileChat 12 | { 13 | public partial class App : Application 14 | { 15 | /// 16 | /// Provides easy access to the root frame of the Phone Application. 17 | /// 18 | /// The root frame of the Phone Application. 19 | public static PhoneApplicationFrame RootFrame { get; private set; } 20 | 21 | /// 22 | /// Constructor for the Application object. 23 | /// 24 | public App() 25 | { 26 | // Global handler for uncaught exceptions. 27 | UnhandledException += Application_UnhandledException; 28 | 29 | // Standard XAML initialization 30 | InitializeComponent(); 31 | 32 | // Phone-specific initialization 33 | InitializePhoneApplication(); 34 | 35 | // Language display initialization 36 | InitializeLanguage(); 37 | 38 | // Show graphics profiling information while debugging. 39 | if (Debugger.IsAttached) 40 | { 41 | // Display the current frame rate counters. 42 | Application.Current.Host.Settings.EnableFrameRateCounter = true; 43 | 44 | // Show the areas of the app that are being redrawn in each frame. 45 | //Application.Current.Host.Settings.EnableRedrawRegions = true; 46 | 47 | // Enable non-production analysis visualization mode, 48 | // which shows areas of a page that are handed off to GPU with a colored overlay. 49 | //Application.Current.Host.Settings.EnableCacheVisualization = true; 50 | 51 | // Prevent the screen from turning off while under the debugger by disabling 52 | // the application's idle detection. 53 | // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run 54 | // and consume battery power when the user is not using the phone. 55 | PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; 56 | } 57 | 58 | } 59 | 60 | // Code to execute when the application is launching (eg, from Start) 61 | // This code will not execute when the application is reactivated 62 | private void Application_Launching(object sender, LaunchingEventArgs e) 63 | { 64 | } 65 | 66 | // Code to execute when the application is activated (brought to foreground) 67 | // This code will not execute when the application is first launched 68 | private void Application_Activated(object sender, ActivatedEventArgs e) 69 | { 70 | } 71 | 72 | // Code to execute when the application is deactivated (sent to background) 73 | // This code will not execute when the application is closing 74 | private void Application_Deactivated(object sender, DeactivatedEventArgs e) 75 | { 76 | } 77 | 78 | // Code to execute when the application is closing (eg, user hit Back) 79 | // This code will not execute when the application is deactivated 80 | private void Application_Closing(object sender, ClosingEventArgs e) 81 | { 82 | } 83 | 84 | // Code to execute if a navigation fails 85 | private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) 86 | { 87 | if (Debugger.IsAttached) 88 | { 89 | // A navigation has failed; break into the debugger 90 | Debugger.Break(); 91 | } 92 | } 93 | 94 | // Code to execute on Unhandled Exceptions 95 | private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) 96 | { 97 | if (Debugger.IsAttached) 98 | { 99 | // An unhandled exception has occurred; break into the debugger 100 | Debugger.Break(); 101 | } 102 | } 103 | 104 | #region Phone application initialization 105 | 106 | // Avoid double-initialization 107 | private bool phoneApplicationInitialized = false; 108 | 109 | // Do not add any additional code to this method 110 | private void InitializePhoneApplication() 111 | { 112 | if (phoneApplicationInitialized) 113 | return; 114 | 115 | // Create the frame but don't set it as RootVisual yet; this allows the splash 116 | // screen to remain active until the application is ready to render. 117 | RootFrame = new PhoneApplicationFrame(); 118 | RootFrame.Navigated += CompleteInitializePhoneApplication; 119 | 120 | // Handle navigation failures 121 | RootFrame.NavigationFailed += RootFrame_NavigationFailed; 122 | 123 | // Handle reset requests for clearing the backstack 124 | RootFrame.Navigated += CheckForResetNavigation; 125 | 126 | // Ensure we don't initialize again 127 | phoneApplicationInitialized = true; 128 | } 129 | 130 | // Do not add any additional code to this method 131 | private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) 132 | { 133 | // Set the root visual to allow the application to render 134 | if (RootVisual != RootFrame) 135 | RootVisual = RootFrame; 136 | 137 | // Remove this handler since it is no longer needed 138 | RootFrame.Navigated -= CompleteInitializePhoneApplication; 139 | } 140 | 141 | private void CheckForResetNavigation(object sender, NavigationEventArgs e) 142 | { 143 | // If the app has received a 'reset' navigation, then we need to check 144 | // on the next navigation to see if the page stack should be reset 145 | if (e.NavigationMode == NavigationMode.Reset) 146 | RootFrame.Navigated += ClearBackStackAfterReset; 147 | } 148 | 149 | private void ClearBackStackAfterReset(object sender, NavigationEventArgs e) 150 | { 151 | // Unregister the event so it doesn't get called again 152 | RootFrame.Navigated -= ClearBackStackAfterReset; 153 | 154 | // Only clear the stack for 'new' (forward) and 'refresh' navigations 155 | if (e.NavigationMode != NavigationMode.New && e.NavigationMode != NavigationMode.Refresh) 156 | return; 157 | 158 | // For UI consistency, clear the entire page stack 159 | while (RootFrame.RemoveBackEntry() != null) 160 | { 161 | ; // do nothing 162 | } 163 | } 164 | 165 | #endregion 166 | 167 | // Initialize the app's font and flow direction as defined in its localized resource strings. 168 | // 169 | // To ensure that the font of your application is aligned with its supported languages and that the 170 | // FlowDirection for each of those languages follows its traditional direction, ResourceLanguage 171 | // and ResourceFlowDirection should be initialized in each resx file to match these values with that 172 | // file's culture. For example: 173 | // 174 | // AppResources.es-ES.resx 175 | // ResourceLanguage's value should be "es-ES" 176 | // ResourceFlowDirection's value should be "LeftToRight" 177 | // 178 | // AppResources.ar-SA.resx 179 | // ResourceLanguage's value should be "ar-SA" 180 | // ResourceFlowDirection's value should be "RightToLeft" 181 | // 182 | // For more info on localizing Windows Phone apps see http://go.microsoft.com/fwlink/?LinkId=262072. 183 | // 184 | private void InitializeLanguage() 185 | { 186 | try 187 | { 188 | // Set the font to match the display language defined by the 189 | // ResourceLanguage resource string for each supported language. 190 | // 191 | // Fall back to the font of the neutral language if the Display 192 | // language of the phone is not supported. 193 | // 194 | // If a compiler error is hit then ResourceLanguage is missing from 195 | // the resource file. 196 | RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage); 197 | 198 | // Set the FlowDirection of all elements under the root frame based 199 | // on the ResourceFlowDirection resource string for each 200 | // supported language. 201 | // 202 | // If a compiler error is hit then ResourceFlowDirection is missing from 203 | // the resource file. 204 | FlowDirection flow = (FlowDirection)Enum.Parse(typeof(FlowDirection), AppResources.ResourceFlowDirection); 205 | RootFrame.FlowDirection = flow; 206 | } 207 | catch 208 | { 209 | // If an exception is caught here it is most likely due to either 210 | // ResourceLangauge not being correctly set to a supported language 211 | // code or ResourceFlowDirection is set to a value other than LeftToRight 212 | // or RightToLeft. 213 | 214 | if (Debugger.IsAttached) 215 | { 216 | Debugger.Break(); 217 | } 218 | 219 | throw; 220 | } 221 | } 222 | } 223 | } -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/AlignmentGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/AlignmentGrid.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/ApplicationIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/ApplicationIcon.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileLarge.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileMedium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileMedium.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/Tiles/FlipCycleTileSmall.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/Tiles/IconicTileMediumLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/Tiles/IconicTileMediumLarge.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/Assets/Tiles/IconicTileSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TerryWahl/Mobile-Multiplatform-Websockets-Android-iOS-Windows-Phone-Web/10d3a2dc8947166040671affe8ec79e73ebca6f8/windows-phone-8/MobileChat/MobileChat/Assets/Tiles/IconicTileSmall.png -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/LocalizedStrings.cs: -------------------------------------------------------------------------------- 1 | using MobileChat.Resources; 2 | 3 | namespace MobileChat 4 | { 5 | /// 6 | /// Provides access to string resources. 7 | /// 8 | public class LocalizedStrings 9 | { 10 | private static AppResources _localizedResources = new AppResources(); 11 | 12 | public AppResources LocalizedResources { get { return _localizedResources; } } 13 | } 14 | } -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/MobileChat.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 10.0.20506 7 | 2.0 8 | {BC8CA4C4-BA0A-4809-BCDE-51E309B3EEF6} 9 | {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 10 | Library 11 | Properties 12 | MobileChat 13 | MobileChat 14 | WindowsPhone 15 | v8.0 16 | $(TargetFrameworkVersion) 17 | true 18 | 19 | 20 | true 21 | true 22 | MobileChat_$(Configuration)_$(Platform).xap 23 | Properties\AppManifest.xml 24 | MobileChat.App 25 | true 26 | 11.0 27 | true 28 | 29 | 30 | true 31 | full 32 | false 33 | Bin\Debug 34 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 35 | true 36 | true 37 | prompt 38 | 4 39 | 40 | 41 | pdbonly 42 | true 43 | Bin\Release 44 | TRACE;SILVERLIGHT;WINDOWS_PHONE 45 | true 46 | true 47 | prompt 48 | 4 49 | 50 | 51 | true 52 | full 53 | false 54 | Bin\x86\Debug 55 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 56 | true 57 | true 58 | prompt 59 | 4 60 | 61 | 62 | pdbonly 63 | true 64 | Bin\x86\Release 65 | TRACE;SILVERLIGHT;WINDOWS_PHONE 66 | true 67 | true 68 | prompt 69 | 4 70 | 71 | 72 | true 73 | full 74 | false 75 | Bin\ARM\Debug 76 | DEBUG;TRACE;SILVERLIGHT;WINDOWS_PHONE 77 | true 78 | true 79 | prompt 80 | 4 81 | 82 | 83 | pdbonly 84 | true 85 | Bin\ARM\Release 86 | TRACE;SILVERLIGHT;WINDOWS_PHONE 87 | true 88 | true 89 | prompt 90 | 4 91 | 92 | 93 | 94 | App.xaml 95 | 96 | 97 | 98 | MobileChat.xaml 99 | 100 | 101 | 102 | True 103 | True 104 | AppResources.resx 105 | 106 | 107 | 108 | 109 | Designer 110 | MSBuild:Compile 111 | 112 | 113 | Designer 114 | MSBuild:Compile 115 | 116 | 117 | 118 | 119 | 120 | Designer 121 | 122 | 123 | 124 | 125 | 126 | PreserveNewest 127 | 128 | 129 | PreserveNewest 130 | 131 | 132 | PreserveNewest 133 | 134 | 135 | PreserveNewest 136 | 137 | 138 | PreserveNewest 139 | 140 | 141 | PreserveNewest 142 | 143 | 144 | 145 | 146 | 147 | PublicResXFileCodeGenerator 148 | AppResources.Designer.cs 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 164 | 165 | -------------------------------------------------------------------------------- /windows-phone-8/MobileChat/MobileChat/MobileChat.xaml: -------------------------------------------------------------------------------- 1 |  21 | 22 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 |