Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

Commit

Permalink
Merge pull request #9 from muharamdani/feature/auto-relogin-and-more-…
Browse files Browse the repository at this point in the history
…modular-code

Refactor | Websocket url
  • Loading branch information
muharamdani authored Mar 17, 2023
2 parents 2505ddb + ea6bda2 commit f3af40c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion dist/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import WebSocket from 'ws';
import * as diff from 'diff';
import { readFileSync } from "fs";
const getSocketUrl = async () => {
const socketUrl = 'wss://tch252531.tch.quora.com';
const tchRand = Math.floor(100000 + Math.random() * 900000); // They're surely using 6 digit random number for ws url.
const socketUrl = `wss://tch${tchRand}.tch.quora.com`;
const credentials = JSON.parse(readFileSync("config.json", "utf8"));
const appSettings = credentials.app_settings.tchannelData;
const boxName = appSettings.boxName;
Expand Down
3 changes: 2 additions & 1 deletion src/websocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import * as diff from 'diff';
import {readFileSync} from "fs";

const getSocketUrl = async () => {
const socketUrl = 'wss://tch252531.tch.quora.com';
const tchRand = Math.floor(100000 + Math.random() * 900000); // They're surely using 6 digit random number for ws url.
const socketUrl = `wss://tch${tchRand}.tch.quora.com`;
const credentials = JSON.parse(readFileSync("config.json", "utf8"));
const appSettings = credentials.app_settings.tchannelData;
const boxName = appSettings.boxName;
Expand Down

0 comments on commit f3af40c

Please sign in to comment.