wssnet_ghost3a 3.0.54

  • Readme
  • Changelog
  • Example
  • Installing
  • new62

node-ghost3a #

Lightweight, web server, websocket server, websocket client. Cluster support. Simple and easy to use.

https://github.com/yangfanyu/node-ghost3a

Install #

PM2 management process is recommended:

npm install pm2 -g

Then install this framework in your project directory:

npm install node-ghost3a

Server and client example #

  git clone https://github.com/yangfanyu/node-ghost3a.git
  
  cd node-ghost3a/example
  
  pm2 start ecosystem.config.js --env development

Then browse http://localhost:8080/ in your modern browser.

You can use pm2 log to see the server logs.

Client for flutter or dart #

Edit dependencies in pubspec.yaml

     dependencies:
       wssnet_ghost3a: ^3.0.52

API usage is the same as index.html in example.

API document #

src_v2 is deprecated

See the source code comments in src_v3 for the framework. My notes are very detailed.

3.0.54 #

  • Add md5 method.

3.0.53 #

  • Fixed a bug for dart client.

3.0.52 #

  • Initial version.

example/example.dart

import 'dart:async';
import 'package:wssnet_ghost3a/wssnet_ghost3a.dart';

void testWssClient() {
  Ghost3a net = Ghost3a('http://localhost:8082/', '123', true, heartick: 3);
  net.setLogLevel(Ghost3a.LOG_LEVEL_ALL);
  net.connect(([List<dynamic> params]) {
    print('onopen');
  }, (int code, String reason, [List<dynamic> params]) {
    print('onclose $code $reason');
  }, (String error, [List<dynamic> params]) {
    print('onerror $error');
  }, (int count, [List<dynamic> params]) {
    print('onretry $count');
  }, (int second, int delay, [List<dynamic> params]) {
    //    print('onsecond $second $delay');
  });

  Timer(Duration(seconds: 60), () {
    net.disconnect();
  });
}

void main() {
  testWssClient();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  wssnet_ghost3a: ^3.0.54

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:wssnet_ghost3a/wssnet_ghost3a.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
62
Learn more about scoring.

We analyzed this package on Nov 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:wssnet_ghost3a/wssnet_ghost3a.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

69 out of 69 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/wssnet_ghost3a.dart. (-1 points)

Analysis of lib/wssnet_ghost3a.dart reported 2 hints:

line 93 col 16: Unnecessary new keyword.

line 97 col 16: Unnecessary new keyword.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
crypto ^2.1.3 2.1.3
encrypt ^3.3.1 3.3.1
Transitive dependencies
args 1.5.2
asn1lib 0.5.14
charcode 1.1.2
clock 1.0.1
collection 1.14.12
convert 2.1.1
meta 1.1.8
pointycastle 1.0.1
typed_data 1.1.6