Skip to content

ukcoderj/DotNetCoreWebsocketAngular2Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

.NET Core MVC/ WebSocket Server with Angular2 Client and Ionic2 Client

A simple .NET Core MVC WebSocket project with a simple angular2 websocket client (from angular2-seed). Additional Ionic2 sample added.

The client is from Angular2-seed, which details how to get that project running.

Angular2: The home page looks at an external websocket service. The 'about' page looks at our MVC websocket handler. Hint: If you add '[all]'... in the textbox, it should broadcast to all connected clients, otherwise the response will only return to the sender. You will need separate browsers (or incognito) to test broadcast

Ionic2: The home page looks at an external websocket service. It does not connect to the MVC service

Usage (Server)

  1. Clone the repository.
  2. Open 'angular2-seed-MvcServerWebsockets' in Visual Studio. You may need to install .NET Core separately.
  3. Hit Run.

Usage (Angular2 Client)

  • Clone or fork this repository
  • Make sure you have node.js installed version 5+
  • Make sure you have NPM installed version 3+
  • WINDOWS ONLY run npm install -g webpack webpack-dev-server typescript to install global dependencies
  • run npm install to install dependencies
  • run npm start to fire up dev server
  • open browser to http://localhost:3000
  • if you want to use other port, open package.json file, then change port in --port 3000 script

Usage (Ionic2)

  • Follow the start tutorial to get Ionic2 installed
  • cd to the project directory.
  • Run ionic serve

To test the Ionic2 APK, you will need to sign it.

To create your key, use these instructions

Add Android cordova platform add android --save

Publish cd "{ProjectDir}" cordova build android --prod --release

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore "{ProjectDir}/platforms/android/build/outputs/apk/my-release-key.keystore" -storepass {KEY} -keypass {KEY} "{ProjectDir}/platforms/android/build/outputs/apk/android-release-unsigned.apk" {KEY}

jarsigner -verify -verbose -certs "{ProjectDir}/platforms/android/build/outputs/apk/android-release-unsigned.apk"

cd to zipalign

cd C:/Program Files (x86)/Android/android-sdk/build-tools/23.0.1

zipalign -v 4 "{ProjectDir}/platforms/android/build/outputs/apk/android-release-unsigned.apk" "{ProjectDir}/platforms/android/build/outputs/apk/android-release-signed.apk"

About

A simple .NET Core MVC WebSocket project with a simple angular2 client, plus Ionic 2 Websocket Client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published