AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Discord proxy webook3/20/2023 In my case the Proxy will be the DS1621xs NAS. Today I will teach you how to access your local NAS via Proxy. The other NAS, an RS422 , has no DDNS registered and I only access it in my local network. For example, in my case I have a DS1621xs with a DDNS address. So, let’s say you have more than one Synology NAS in your local network, but only one device has Internet access via DDNS like a address or something else. In this case, the NAS with DDNS will act as proxy. Only one NAS will have a DDNS address with access to the Internet, while the rest of the NAS devices will not. Today I want to show you how to Reverse Proxy multiple NAS devices in the same local area network using your NAS. I hope this answers your question and that I'm not just misunderstanding.A few days ago I showed you how to Reverse Proxy an IP camera using your Synology NAS and how to Reverse Proxy your router. This post might help you, I recommend reading it. Var newconfig = require('config.json') // fetch new config.json so that you don't have to refresh the bot Var stringifiedconfig = JSON.Stringify(config) // convert the JSON content to a string so that we can put the JSON into the fileįs.writeFile('config.json', stringifiedconfig) // replace the value of config.json with the stringified config. In your case, this is where you'll want to manipulate the JSON to adjust the specific values of your json keys to the desired valuesĬonsole.log(config) // should show config.json the newly added content To give a programatic view of what I'm saying, I'll try my best to show it in code var config = require('config.json') // get config.json's value into the variableĬonsole.log(config) // this shows the value of the variable, which should print out a json object to the command lineĬonfig.push(newstuff) // add new data to the JSON, however this only affects the variable. Then when you were done and wanted to update the json file to persist the data, you would use JSON.Stringify() on the variable holding all that data, and use fs to replace config.json's value with the stringified JSON. This lets you run javascript operations on it without affecting the overall aspect of the json file (such as adding onto it, etc). What I noticed is that when you require() a json file, the contents get cached into the variable, therefore editing the values in the variable change only the contents of the cached json within the variable, not the json file itself. The code for it is long gone, but I think you might be able to get something out of this. json file as a temporary database in one of my older bots. I accomplished this before when I was trying to use a. Please let me know if this is possible Thanks!Īlso Please let me know if it is unclear, i can provide more information. I want to edit a specific part rather than the Whole entire config. setDescription('Config file successfully updated.\nstop the bot with `$stop`') setDescription('Failed to parse ini file.')įs.writeFileSync(instanceDirectory '/settings.ini', configText) I'm stuck at a part where I want to change a specific part of the config.json and not the whole config. Im new to coding and I've coded myself a discord bot coded in Node.js which can change the whole config.json, start the bot, stop the bot, create instances etc.
0 Comments
Read More
Leave a Reply. |