Jump to content

sagnik

Members
  • Posts

    474
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by sagnik

  1. Hi, I'm creating a social media with a real-time chat application using PHP WebSocket, the basic functionalities are working properly but I need to implement some other features as well. So I need help with the following related to the chat application:

    1. Login to the WebSocket using the credentials users use to log into the social media.
    2. Allow users to chat with their friends only.
    3. Identify users from the database using their ID and fetch data from the database.
    4. Show online/offline status based on the WebSocket.
    5. Show if a message is pending/sent/delivered/seen status.
    6. Show typing notification to the other user.

    I'm attaching a screenshot of the chat screen:

    image.thumb.png.5201a746609b23040bf424b4983150d5.png

  2. On 3/27/2024 at 2:17 AM, wolstech said:

    I spoke with Krydos on this, he confirmed this issue does not look to be on our end, but rather an issue with DNS propagation of the name server settings from in.eu.org. He was able to show that some servers around the world are reporting cloudns as the DNS provider, which is obviously incorrect.

    You'll need to contact the admins who handle in.eu.org for assistance with this issue (note that in.eu.org has a different admin from eu.org).

    image.thumb.png.477c22fa25fd0cacae653baf1b85e067.png

  3.   

    And also I need to fix the errors with the WS server. I can't retrieve the headers needed to upgrade the request.

    image.thumb.png.d16ab8f44402f1c4449e1826b4e699df.png

     

    Check the headers printed:

    image.thumb.png.1c65e82cf1b411c1c30066fe8ca5bb58.png

     

     

    I've found some errors in the Apache log file:

    [Thu Mar 21 15:58:36.854208 2024] [proxy:error] [pid 521884:tid 10728] (20014)Internal error (specific information not available): [client 192.168.0.10:51010] AH01084: pass request body failed to 192.168.0.10:9443 (netmate.com)
    [Thu Mar 21 15:58:36.854208 2024] [proxy:error] [pid 521884:tid 10728] [client 192.168.0.10:51010] AH00898: Error during SSL Handshake with remote server returned by /ws/
    [Thu Mar 21 15:58:49.946711 2024] [proxy_wstunnel:trace1] [pid 521884:tid 10720] mod_proxy_wstunnel.c(51): [client 192.168.0.10:51169] canonicalising URL //netmate.com:9443
    [Thu Mar 21 15:58:49.947709 2024] [proxy_http:debug] [pid 521884:tid 10720] mod_proxy_http.c(1967): [client 192.168.0.10:51169] AH01113: HTTP: declining URL wss://netmate.com:9443/
    [Thu Mar 21 15:58:49.947709 2024] [proxy_wstunnel:debug] [pid 521884:tid 10720] mod_proxy_wstunnel.c(321): [client 192.168.0.10:51169] AH02451: serving URL wss://netmate.com:9443/
    [Thu Mar 21 15:58:49.947709 2024] [proxy_wstunnel:trace2] [pid 521884:tid 10720] mod_proxy_wstunnel.c(126): [client 192.168.0.10:51169] sending request
    [Thu Mar 21 16:08:49.948173 2024] [proxy:error] [pid 521884:tid 10720] (20014)Internal error (specific information not available): [client 192.168.0.10:51169] AH01084: pass request body failed to 192.168.0.10:9443 (netmate.com)
    [Thu Mar 21 16:08:49.948173 2024] [proxy:error] [pid 521884:tid 10720] [client 192.168.0.10:51169] AH00898: Error during SSL Handshake with remote server returned by /ws/

     

  4. Okay, but can you add the subdomains of sgsoft.in.eu.org:

    By removing the following domains:

    For the document roots, I'm unable to change those values as there's no option to change this. I somehow need to match it like /home/sgn/public_html instead of "/htdocs/".

     

    And one more thing, how can the domain "sgads.eu.org" resolve perfectly, I mean, I've not set the DNS to 'HelioHost" yet.

    And previously, when Heliohost was using cPanel as a control panel, I had to use "ClouDNS" to set the nameservers. But this time the nameservers were not even set to point to Heliohost nameservers.

  5. Okay fine. Here's the list:

    The domains:

    The subdomains:

    Document roots to be set for the domains:

    Document roots to be set for the subdomains:

     

    And if the list of domains and subdomains exceeds the limit of 10 domains in total, then skip the following domains:

    And all the subdomains of sgsoft.in.eu.org.

     

  6. On 6/23/2023 at 1:02 PM, sagnik said:

    Hi! I'm totally new to Plesk, so I might be missing something.

    But anyway, I need to add the following domains as add-ons:

    And the following subdomains:

    And I need to park sgnetworks.in.eu.org on the main domain sgnetworks.heliohost.us. Also, I need to change the document root to be set to match the Apache HTTPD document root "/home/user/public_html".

     

    For erp.estatehunt.in.eu.org : /{{home_dir}}/eh/public_html (preferred) or /{{home_dir}}/sgn/eh/public_html or /{{home_dir}}/sgn/public_html/eh/public_html :

    • {{user}} = sgn
    • {{addonuser}} = eh
    • {{subuser}} = erp

     

    Document roots to be set:

    • sgnetworks.in.eu.org (for main domain): /{{home_dir}}/sgn/public_html
    • estatehunt.in.eu.org : /{{home_dir}}/eh/public_html (preferred) or /{{home_dir}}/sgn/eh/public_html or /{{home_dir}}/sgn/public_html/eh/public_html
    • sgads.in.eu.org : /{{home_dir}}/sga/public_html (preferred) or /{{home_dir}}/sgn/sga/public_html or /{{home_dir}}/sgn/public_html/sga/public_html
    • sgsoft.in.eu.org : /{{home_dir}}/sgs/public_html (preferred) or /{{home_dir}}/sgn/sgs/public_html or /{{home_dir}}/sgn/public_html/sgs/public_html
    • questry.in.eu.org : /{{home_dir}}/questry/public_html (preferred) or /{{home_dir}}/sgn/questry/public_html or /{{home_dir}}/sgn/public_html/questry/public_html
    • ceramic.eu.org : /{{home_dir}}/ceramic/public_html (preferred) or /{{home_dir}}/sgn/ceramic/public_html or /{{home_dir}}/sgn/public_html/ceramic/public_html

    For all subdomains: if it's set to /{{home_dir}}/{{addonuser}}/public_html/{{subuser}} (preferred) or /{{home_dir}}/sgn/public_html/{{addonuser}}/{{subuser /{{home_dir}}/sgn/public_html/{{addonuser}}/public_html/{{subuser}}, for example,

    • erp.estatehunt.in.eu.org : /{{home_dir}}/eh/public_html/erp (preferred) or /{{home_dir}}/sgn/public_html/eh/erp or /{{home_dir}}/sgn/public_html/eh/public_html/erp

     

    @Krydos did you added the subdomains as well?

    And you said that, I've a limit of 10 domains, so can you add the remaining 2 domains as well? If yes, then just read the quoted message, which properly states what I need.

  7. Hi! I'm totally new to Plesk, so I might be missing something.

    But anyway, I need to add the following domains as add-ons:

    And the following subdomains:

    And I need to park sgnetworks.in.eu.org on the main domain sgnetworks.heliohost.us. Also, I need to change the document root to be set to match the Apache HTTPD document root "/home/user/public_html".

     

    For erp.estatehunt.in.eu.org : /{{home_dir}}/eh/public_html (preferred) or /{{home_dir}}/sgn/eh/public_html or /{{home_dir}}/sgn/public_html/eh/public_html :

    • {{user}} = sgn
    • {{addonuser}} = eh
    • {{subuser}} = erp

     

    Document roots to be set:

    • sgnetworks.in.eu.org (for main domain): /{{home_dir}}/sgn/public_html
    • estatehunt.in.eu.org : /{{home_dir}}/eh/public_html (preferred) or /{{home_dir}}/sgn/eh/public_html or /{{home_dir}}/sgn/public_html/eh/public_html
    • sgads.in.eu.org : /{{home_dir}}/sga/public_html (preferred) or /{{home_dir}}/sgn/sga/public_html or /{{home_dir}}/sgn/public_html/sga/public_html
    • sgsoft.in.eu.org : /{{home_dir}}/sgs/public_html (preferred) or /{{home_dir}}/sgn/sgs/public_html or /{{home_dir}}/sgn/public_html/sgs/public_html
    • questry.in.eu.org : /{{home_dir}}/questry/public_html (preferred) or /{{home_dir}}/sgn/questry/public_html or /{{home_dir}}/sgn/public_html/questry/public_html
    • ceramic.eu.org : /{{home_dir}}/ceramic/public_html (preferred) or /{{home_dir}}/sgn/ceramic/public_html or /{{home_dir}}/sgn/public_html/ceramic/public_html

    For all subdomains: if it's set to /{{home_dir}}/{{addonuser}}/public_html/{{subuser}} (preferred) or /{{home_dir}}/sgn/public_html/{{addonuser}}/{{subuser}} or /{{home_dir}}/sgn/public_html/{{addonuser}}/public_html/{{subuser}}, for example,

    • erp.estatehunt.in.eu.org : /{{home_dir}}/eh/public_html/erp (preferred) or /{{home_dir}}/sgn/public_html/eh/erp or /{{home_dir}}/sgn/public_html/eh/public_html/erp

     

  8. Okay, so I can create an account and  move back to Tommy at some point.

    And one more thing, I've just checked, I'm not able to do some operations (I don't remember which one) in Helionet due to my current rank, but currently I've 451 posts and I'm still a Rank I member. Previously (before the rejuvenation of Helionet, I was a Rank VII member). Is there any way to fix this?

  9. Quote

    src/js/SGNUIKit.loader.js:29:1 - error TS9005: Declaration emit for this file requires using private name 'SGNUKConfig'. An explicit type annotation may unblock declaration emit.

    29 const forEach = (obj, callback) => {
       ~~~~~

     

    • Here's the part of the code:
    /**
     * Performs the specified action for each element in an object.
     *
     * @param {Object} obj
     * @param {(value:any, key:string)=>void} callback A function that accepts up to three arguments. forEach calls the <b><i>callback</i></b> function one time for each element in the object.
     */
    const forEach = (obj, callback) => {
    	let value;
    	//context = context || this;  //apply the function to 'this' by default
    
    	for(const key in obj) {
    		if(key !== 'length' && obj.hasOwnProperty(key)) {  //to rule out inherited properties
    			value = obj[key];
    			if(typeof callback === 'function')
    				callback(value, key);
    		}
    	}
    }
    
    /**
     * Appends new elements to the end of an object, and returns the new length of the object.
     * @param {Object} obj
     * @param {...any} items New elements to add to the object.
     */
    const push = (obj, ...items) => {
    	let k = obj.length || 0;
    
    	items.forEach((value) => {
    		obj[k] = value;
    		k++;
    		obj.length = k;
    	});
    }
    
    const SGNUIKit = {
    	isReady: false,
    	isInit: false,
    	isPreloaderHeld: false,
    	configs: {
    		'urls': {
    			'api': {
    				'geonames': 'https://secure.geonames.org/',
    				'osm': 'https://nominatim.openstreetmap.org/'
    			},
    		},
    		'api': {
    			'geonames': '' //username
    		},
    		'geocoding': {
    			'defaultAPI': 'osm'
    		}
    	},
    	components: {},
    	onChangeListener: {},
    	onInitListener: {},
    	onReadyListener: {},
    	callCounts: {
    		'init': 0,
    		'ready': 0,
    		'config': 0,
    		'component': 0,
    		'holdPreloader': 0,
    	},
    
    	/**
    	 * This callback is called when a component is loaded/removed or the status of readiness is changed.
    	 *
    	 * @callback SGNUIKitChangeCallback
    	 * @param {string} state The name of the state which is changed.
    	 * @param {boolean|JSON} value The value of the state which is changed.
    	 * @param {JSON} components The <b><i>JSON</i></b> object of loaded <b>SGNUIKit</b> components, or an empty <b><i>JSON</i></b> object if no components loaded.
    	 */
    	/**
    	 * This callback is called when <b>SGNUIKit</b> is ready.
    	 *
    	 * @callback SGNUIKitReadyCallback
    	 * @param {boolean} isReady the status of readiness of <b>SGNUIKit</b>.
    	 */
    
    	/**
    	 * Add a loaded <b>SGNUIKit</b> component.
    	 *
    	 * @param {{}} config The <b><i>JSON</i></b> object of the <b>SGNUIKit</b> configuration options.
    	 */
    	set config(config) {
    		if(config !== undefined && config !== null && config !== "") {
    			this.configs = new SGNUKConfig(config);
    			this.callCounts.config++;
    
    			forEach(this.onChangeListener, (listener) => listener("config", config, this.configs));
    		}
    	},
    
    	/**
    	 * Get the list of loaded <b>SGNUIKit</b> components.
    	 *
    	 * @return {Object} The <b><i>JSON</i></b> object of loaded <b>SGNUIKit</b> components, or an empty <b><i>JSON</i></b> object if no components loaded.
    	 */
    	get config() {
    		return this.configs;
    	},
    
    	/**
    	 * Add a loaded <b>SGNUIKit</b> component.
    	 *
    	 * @param {{}} value The <b><i>JSON</i></b> object of the loaded <b>SGNUIKit</b> component.
    	 */
    	set component(value) {
    		if(value !== undefined && value !== null && value !== "") {
    			Object.assign(this.components, value);
    			this.callCounts.component++;
    
    			forEach(this.onChangeListener, (listener) => listener("components", value, this.components));
    			//this.onChangeListener.forEach((listener) => listener("components", value, this.components));
    		}
    	},
    
    	/**
    	 * Get the list of loaded <b>SGNUIKit</b> components.
    	 *
    	 * @return {object} The <b><i>JSON</i></b> object of loaded <b>SGNUIKit</b> components, or an empty <b><i>JSON</i></b> object if no components loaded.
    	 */
    	get component() {
    		return this.components;
    	},
    
    	/**
    	 * Check if a <b>SGNUIKit</b> component is loaded.
    	 *
    	 * @param {string|number} id The <i>ID</i> of the <b>SGNUIKit</b> component to check.
    	 */
    	isComponentLoaded: function(id) {
    		return this.components.hasOwnProperty(id);
    	},
    
    	/**
    	 * Set the status of readiness of <b>SGNUIKit</b>.
    	 *
    	 * @param {boolean} isInit The the status of readiness of <b>SGNUIKit</b>.
    	 */
    	set init(isInit) {
    		this.isInit = isInit;
    		this.callCounts.init++;
    		forEach(this.onChangeListener, (listener) => listener("init", this.isInit));
    
    		if(isInit)
    			forEach(this.onInitListener, (listener) => listener(isInit));
    	},
    
    	/**
    	 * Get the status of readiness of <b>SGNUIKit</b>.
    	 *
    	 * @return {boolean} <b><i>TRUE</i></b> if <b>SGNUIKit</b> is ready, <b><i>FALSE</i></b> otherwise.
    	 */
    	get init() {
    		return this.isInit;
    	},
    
    	/**
    	 * Set the status of readiness of <b>SGNUIKit</b>.
    	 *
    	 * @param {boolean} isReady The the status of readiness of <b>SGNUIKit</b>.
    	 */
    	set ready(isReady) {
    		this.isReady = isReady;
    		this.callCounts.ready++;
    		forEach(this.onChangeListener, (listener) => listener("ready", this.isReady));
    		//this.onChangeListener.forEach((listener) => listener("ready", this.isReady));
    
    		if(isReady)
    			forEach(this.onReadyListener, (listener) => listener(isReady));
    		//this.onReadyListener.forEach((listener) => listener(isReady));
    	},
    
    	/**
    	 * Get the status of readiness of <b>SGNUIKit</b>.
    	 *
    	 * @return {boolean} <b><i>TRUE</i></b> if <b>SGNUIKit</b> is ready, <b><i>FALSE</i></b> otherwise.
    	 */
    	get ready() {
    		return this.isReady;
    	},
    
    	/**
    	 * Hold the <b>SGNUIKit</b> preloader even after  <b>SGNUIKit</b> has finished loading the components.
    	 *
    	 * @param {boolean} hold The the status of readiness of <b>SGNUIKit</b>.
    	 */
    	set holdPreloader(hold) {
    		this.isPreloaderHeld = hold;
    		this.callCounts.holdPreloader++;
    		forEach(this.onChangeListener, (listener) => listener("holdPreloader", this.isPreloaderHeld));
    		//this.onChangeListener.forEach((listener) => listener("holdPreloader", this.isPreloaderHeld));
    	},
    
    	/**
    	 * Get the status of readiness of <b>SGNUIKit</b>.
    	 *
    	 * @return {boolean} <b><i>TRUE</i></b> if <b>SGNUIKit</b> is ready, <b><i>FALSE</i></b> otherwise.
    	 */
    	get holdPreloader() {
    		return this.isPreloaderHeld;
    	},
    
    	/**
    	 * Set the handler for <b>SGNUIKit</b> <b><i>OnChange</i></b> event, which will be triggered when a component is loaded/removed or the status of readiness is changed.
    	 *
    	 * @param {SGNUIKitChangeCallback}listener
    	 * @param {string|number}[id=undefined]
    	 */
    	setOnChangeListener: function(listener, id) {
    		if(typeof id !== 'string' || $.isNumeric(id))
    			this.onChangeListener[id] = listener;
    		else
    			push(this.onChangeListener, listener);
    	},
    
    	/**
    	 * Set the handler for <b>SGNUIKit</b> <b><i>OnReady</i></b> event, which will be triggered when the <b>SGNUIKit</b> is ready.
    	 *
    	 * @param {SGNUIKitReadyCallback}listener
    	 * @param {string|number}[id=undefined]
    	 */
    	setOnInitListener: function(listener, id) {
    		if(typeof id !== 'string' || $.isNumeric(id))
    			this.onInitListener[id] = listener;
    		else
    			push(this.onInitListener, listener);
    
    		if(this.init)
    			forEach(this.onInitListener, (listener) => listener(this.isInit));
    	},
    
    	/**
    	 * Set the handler for <b>SGNUIKit</b> <b><i>OnReady</i></b> event, which will be triggered when the <b>SGNUIKit</b> is ready.
    	 *
    	 * @param {SGNUIKitReadyCallback}listener
    	 * @param {string|number}[id=undefined]
    	 */
    	setOnReadyListener: function(listener, id) {
    		if(typeof id !== 'string' || $.isNumeric(id))
    			this.onReadyListener[id] = listener;
    		else
    			push(this.onReadyListener, listener);
    
    		if(this.ready)
    			forEach(this.onReadyListener, (listener) => listener(this.isReady));
    		//this.onReadyListener.forEach((listener) => listener(this.ready));
    	},
    };
    window.SGNUIKit = SGNUIKit;
    
    if(typeof jQuery === 'undefined') {
      // EMBED JQUERY
    }
    
    /***
     * @return {SGNUKConfig}
     */
    const SGNUKConfig = function(config) {
    	const plugin = this;
    	const _defaults = {
    		'urls': {
    			'api': {
    				'geonames': 'https://secure.geonames.org/',
    				'osm': 'https://nominatim.openstreetmap.org/'
    			},
    		}
    	}
    	plugin.config = {
    		'api': {
    			'geonames': undefined //username
    		},
    		'geocoding': {
    			'defaultAPI': 'osm'
    		}
    	}
    
    	const init = () => {
    		plugin.config = Object.assign(plugin.config, config);
    		plugin.config = Object.assign(plugin.config, _defaults);
    	}
    
    	init();
    
    	return plugin;
    };
    
    ((callback) => {
    	const head  = document.head || document.getElementsByTagName("head")[0],
    	      style = document.createElement("style");
    	const currentScript = document.currentScript || document.querySelector("script[src*=\"SGNUIKit.loader.js\"]");
    	let preloader = `\t\t\t<div class="preloader">\n`;
    	//OTHER CODES HERE
    
    	head.appendChild(style);
    
    	preloaderElem.innerHTML = preloader;
    
    	window.onload = function() {
    		document.body.classList.add("has-preloader");
    		document.body.insertBefore(preloaderElem, document.body.firstChild);
    
    		if(typeof callback === 'function')
    			callback();
    	};
    })(() => {
    	(async precallback => {
    		const title = document.title;
    		if(title !== undefined)
    			document.title = "Loading...";
    
    		if(window.jQuery)
    			$.holdReady(true);
          	//OTHER CODES HERE
    		async function finishLoad() {
    			progress = (filestoload > 0) ? Math.round((filesloaded * 100) / filestoload) : 100;
    
    			await new Promise(resolve => {
    				if(filesloaded >= filestoload) {
    					resolve();
    				}
    			}).then(function() {
    				document.querySelector('head > title').innerHTML = title;
    				if(typeof precallback === "function" && progress === 100)
    					precallback();
    			});
    		}
        })(function() {
    		(async callback => {
    			(() => {
    				const startLoad = new Promise(async function(resolve) {
    					await loadStyle(0);
    					await loadScript(0);
    					if(loaded === total)
    						resolve();
    				});
    
    				startLoad.then(() => {
    					finishLoad();
    				});
    			})();
    			async function finishLoad() {
    				const progress = Math.round((loaded * 100) / total);
    
    				await new Promise(resolve => {
    					if(loaded === total) {
    						resolve();
    					}
    				}).then(function() {
    					if(typeof callback === "function")
    						callback(loaded, total, progress);
    				});
    			}
    		})((loaded, total, progress) => {
    			if(progress === 100) {
    				SGNUIKit.init = true;
    
    				const styles = document.querySelector("style#sgn-uikit-styles");
    				const left = document.querySelector("style[data-cke=\"true\"]");
    				if(left !== null)
    					left.parentNode.removeChild(left);
    				if(styles !== null)
    					styles.parentNode.removeChild(styles);
    
    				$.holdReady(false);
    				jQuery.ready();
    			}
    		});
    	});
    	(() => {
    		SGNUIKit.setOnChangeListener((prop, value) => {
    			if(prop === 'holdPreloader') {
    				if(SGNUIKit.init && !value) {
    					finalize(true);
    				}
    			} else {
    				if(prop === 'init' && value) {
    					finalize(false);
    				}
    			}
    		}, 'sgn-uk-prop-change-listener');
    	})();
    });

     

    • tsconfig.json
    {
    	"include": [
    		//"./src/addons/*.js",
    		"./src/js/*.js"
    	],
    	"compilerOptions": {
    		"outDir": "./dist/lib",
    		"declarationDir": "dist/types",
    		"target": "ES6",
    		"module": "ES6",
    		"moduleResolution": "Classic",
    		"strictPropertyInitialization": false,
    		"esModuleInterop": true,
    		"noImplicitAny": true,
    		"noImplicitReturns": true,
    		"noImplicitThis": true,
    		"allowSyntheticDefaultImports": true,
    		"removeComments": true,
    		"allowJs": true,
    		"checkJs": true,
    		"strict": false,
    		"skipLibCheck": true,
    		"allowUmdGlobalAccess": true,
    		"alwaysStrict": true,
    		"useDefineForClassFields": true,
    		// Generate d.ts files
    		"declaration": true,
    		// only output d.ts files
    		"emitDeclarationOnly": true,
    		"declarationMap": true,
    		//"types": [],
    		"typeRoots": [
    			"./src/types"
    		]
    	},
    	"exclude": [
    		"node_modules",
    		"./node_modules",
    		"./node_modules/*",
    		"./node_modules/@types/node/index.d.ts",
    		".backup",
    		".github",
    		"build",
    		"demos",
    		"dist",
    		"docs",
    		"release"
    	]
    }

     

×
×
  • Create New...