🔌 AirDCPP socket refactoring
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
import { Socket } from "airdcpp-apisocket";
|
||||
|
||||
const options = {
|
||||
url: "wss://sab.rishighan.com/api/v1/",
|
||||
autoReconnect: false,
|
||||
reconnectInterval: 5,
|
||||
logLevel: "verbose",
|
||||
ignoredListenerEvents: [
|
||||
"transfer_statistics",
|
||||
"hash_statistics",
|
||||
"hub_counts_updated",
|
||||
],
|
||||
};
|
||||
|
||||
const APISocket = Socket(options, window.WebSocket as any);
|
||||
type SocketType = typeof APISocket;
|
||||
export { SocketType as APISocket };
|
||||
|
||||
export default APISocket;
|
||||
class AirDCPPSocket {
|
||||
constructor(configuration) {
|
||||
const options = {
|
||||
url: `wss://${configuration.hostname}/api/v1/`,
|
||||
autoReconnect: false,
|
||||
reconnectInterval: 5,
|
||||
logLevel: "verbose",
|
||||
ignoredListenerEvents: [
|
||||
"transfer_statistics",
|
||||
"hash_statistics",
|
||||
"hub_counts_updated",
|
||||
],
|
||||
};
|
||||
const AirDCPPSocketInstance = Socket(options, window.WebSocket as any);
|
||||
return AirDCPPSocketInstance;
|
||||
}
|
||||
}
|
||||
export default AirDCPPSocket;
|
||||
|
||||
Reference in New Issue
Block a user