Skip to content

Commit

Permalink
Merge 5baf193 into 71094ee
Browse files Browse the repository at this point in the history
  • Loading branch information
DustinAlandzes committed Apr 15, 2021
2 parents 71094ee + 5baf193 commit 8c58d48
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
],
"dependencies": {
"@shelacek/ubjson": "^1.0.1",
"@types/mitm": "^1.3.3",
"enet": "^0.2.9",
"iconv-lite": "^0.6.2",
"lodash": "^4.17.19",
"mitm": "^1.7.1",
"moment": "^2.27.0",
"reconnect-core": "^1.3.0",
"semver": "^7.3.2"
Expand Down
2 changes: 1 addition & 1 deletion src/console/dolphinConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class DolphinConnection extends EventEmitter implements Connection {
},
3,
1337, // Data to send, not sure what this is or what this represents
(err: any, newPeer: any) => {
(err: Error, newPeer: Peer) => {
if (err) {
console.error(err);
return;
Expand Down
41 changes: 41 additions & 0 deletions test/console.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ConsoleConnection, DolphinConnection } from "../src";
import Mitm from "mitm";

var mitm = Mitm();
mitm.on("connection", function (socket: any) {
socket.write("Hello back!");
});

mitm.on("connect", function (socket: any) {
socket.write("Hello back!");
});

describe("when using console folder", () => {
it("console connection should work", () => {
mitm.disable();

const connection = new ConsoleConnection();
connection.connect("localhost", 667);
connection.on("data", (data) => {
console.log(data);
});

connection.on("statusChange", (status) => {
console.log(status);
});

connection.getStatus();
connection.getSettings();
connection.getDetails();
connection.disconnect();
});

it("dolphin connection should work", () => {
const connection = new DolphinConnection();
connection.connect("localhost", 667);
connection.getStatus();
connection.getSettings();
connection.getDetails();
connection.disconnect();
});
});
22 changes: 21 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,13 @@
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==

"@types/mitm@^1.3.3":
version "1.3.3"
resolved "https://registry.yarnpkg.com/@types/mitm/-/mitm-1.3.3.tgz#d5f0d27c4db4786efd1f6b0293636dbdaf483c02"
integrity sha512-tu5eGco+prX9WpFE80pUoV7aKzlu1wGJLfgG7/ILXN9rdPzc4YjxA0dQJxKJcUSbtjcYL7mDDdBbD6ZiyG00bw==
dependencies:
"@types/node" "*"

"@types/node@*":
version "14.0.20"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.20.tgz#0da05cddbc761e1fa98af88a17244c8c1ff37231"
Expand Down Expand Up @@ -3736,6 +3743,14 @@ minimist@^1.1.1, minimist@^1.2.0, minimist@^1.2.5:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

mitm@^1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/mitm/-/mitm-1.7.1.tgz#f79771d4992734f6b77ee45d1bffa1bb218e28a9"
integrity sha512-SX2qv5zz+MxjcgLxbByE+iZachquhDg9xlIuNd22L3h7auFEKS9DaBUTiKv+REx+ZOK//Fmk0S8MaPlXAEYfOg==
dependencies:
semver ">= 5 < 6"
underscore ">= 1.1.6 < 1.6"

mixin-deep@^1.2.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
Expand Down Expand Up @@ -4631,7 +4646,7 @@ semver-regex@^2.0.0:
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-2.0.0.tgz#a93c2c5844539a770233379107b38c7b4ac9d338"
integrity sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0:
"semver@2 || 3 || 4 || 5", "semver@>= 5 < 6", semver@^5.4.1, semver@^5.5.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down Expand Up @@ -5237,6 +5252,11 @@ unbox-primitive@^1.0.0:
has-symbols "^1.0.2"
which-boxed-primitive "^1.0.2"

"underscore@>= 1.1.6 < 1.6":
version "1.5.2"
resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.5.2.tgz#1335c5e4f5e6d33bbb4b006ba8c86a00f556de08"
integrity sha1-EzXF5PXm0zu7SwBrqMhqAPVW3gg=

union-value@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"
Expand Down

0 comments on commit 8c58d48

Please sign in to comment.