Remote access to IIS-express - iis

Usually when I start my web application, the browser will open https://localhost:44305
But I want to reach the site from my phone. I've tried changing the applicationhost configfile, firewall inbound rules and all that. But then I found this little thing iisexpress-github
I type this in my console: iisexpress-proxy https://localhost:44305 to 3005
Which results in this line: Proxying https://localhost:44305 to network interfaces:
Ethernet: 192.168.10.41:3005
Listening... [press Control-C to exit]
After following instructions, the browser gives following error: 'Aw snap! Something went wrong. Check your console to see the error.'
And then I look at my console which says the following:
Error: unable to verify the first certificate
at Error (native)
at TLSSocket.<anonymous> (_tls_wrap.js:1016:38)
at emitNone (events.js:67:13)
at TLSSocket.emit (events.js:166:7)
at TLSSocket._finishInit (_tls_wrap.js:585:8)
Usually my site is https, but this seems only to proxy to normal http.
What to do?

Related

In Linux how do you set it that Google Chrome runs in debugging mode by default

I specifically need this for puppeteer to open a window in my current browser so that my user data can be accessed and I can login to places automatically
In Windows, you enable the setting by adding this to the shortcut icon's 'target' field, '–remote-debugging-port=9222'
This will automatically run Chrome with that setting so you have all your login sessions available
How can I have the same effect in Linux where I enable the setting permanently?
There is a way to run Chrome in this way by running /usr/bin/google-chrome-stable --remote-debugging-port=9220 in your terminal, but where can I edit a file to have this permanently enabled?
I've also run into a small error right now trying to start my puppeteer script.
FetchError: Failed to fetch browser webSocket URL from http://localhost:9222/json/version: request to http://localhost:9222/json/version failed, reason: connect ECONNREFUSED 127.0.0.1:9222
at ClientRequest.<anonymous> (/home/me/Coding/whatsapp-bot-puppeteer/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (node:events:526:28)
at Socket.socketErrorListener (node:_http_client:442:9)
at Socket.emit (node:events:526:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
type: 'system',
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED'
}
I'm Linux noob, so I need some help please ^-^
I have found a slight workaround, but it does require you to create a chrome instance through the terminal and then use a websocket connection string
You will also have to log into your new chrome window and sign in wherever
/usr/bin/google-chrome-stable --remote-debugging-port=9222 --no-first-run --no-default-browser-check --user-data-dir=remote-profile
Running this in a Linux terminal will provide you with a ws connection you copy and then paste into your puppeteer script
Please look here for an example:
https://blog.nutjane.me/how-to-run-puppeteer-with-existing-chrome-profile-f42954bfc70c
You just have to make sure not to close this browser instance if you're planning on having a puppeteer script run the whole time. Otherwise you'll have to restart the chrome browser from the terminal and update the ws connection string in your puppeteer file :)
I've tested a quick script with puppeteer now, and I am having success with it :D

Connect to stratum server in NODEJS

I'm trying for several days to connect to a stratum server in nodejs. But I don't get my code working.
I've tried several npm packages but most of them are outdated.
Then I found node-stratum.
This package works fine locally so I expected that it works also with a remote server.
After I changed to host and port to pool.minexmr.com with port number 4444
I got this error message
Oops error: Error: Stratum request without method or result field
at serverForEachCommand (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\server.js:350:19)
at arrayEach (C:\Users\JP\Documents\xmr-web\node_modules\stratum\node_modules\lodash\index.js:1289:13)
at Function.<anonymous> (C:\Users\JP\Documents\xmr-web\node_modules\stratum\node_modules\lodash\index.js:3345:13)
at Object.processCommands (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\server.js:298:9)
at Object.handleData (C:\Users\JP\Documents\xmr-web\node_modules\stratum\lib\client.js:138:38)
at Socket.twoArgs (C:\Users\JP\Documents\xmr-web\node_modules\better-curry\index.js:74:18)
at Socket.emit (events.js:315:20)
at addChunk (_stream_readable.js:295:12)
at readableAddChunk (_stream_readable.js:271:9)
at Socket.Readable.push (_stream_readable.js:212:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23)
I used to code in the example/client
My full code is here codepile
I also tried to change the host to miningpoolhub but there I got no error and it stops by the console.log('Sent!') so I figured out that I better stick with pool.minexmr.com
In the codepile I also added the other logs from the terminal
Okay, finally I got the answer.
Monero stratum has a different payload than Bitcoin
With Wireshark I filtered the payload out en changed the client code van node-stratum.
I changed the node-stratum core code a bit too.

CERT_HAS_EXPIRED error when a POST request is made through npm request module on Nodejs, Certificate is valid however

when i call a POST endpoint from npm request module in my nodejs app (hosted on elasticbeanstalk aws). it gives me CERT_HAS_EXPIRED error, however my ssl certificate is valid and works perfectly when someone visit our site.
this started happening randomly 3 days earlier.
does anyone know what can be done? to fix it?
{ Error: certificate has expired
at TLSSocket.<anonymous> (_tls_wrap.js:1088:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:188:7)
at TLSSocket._finishInit (_tls_wrap.js:610:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:440:38) code: 'CERT_HAS_EXPIRED' }
So #Salahi's comment was correct, support.sectigo.com/Com_KnowledgeDetailPage?Id=kA03l00000117LT
it wasn't a problem on our end, but one of the root certificates expired for the services we were trying to access, and therefore were receiving this error.

error after typing "node enrollAdmin.js" on windows

node enrollAdmin.js
error: [FabricCAClientService.js]: Failed to enroll admin, error:%o message=Calling enrollment endpoint failed with error [Error: con
nect ECONNREFUSED 127.0.0.1:7054], stack=Error: Calling enrollment endpoint fail
ed with error [Error: connect ECONNREFUSED 127.0.0.1:7054]
at ClientRequest.request.on (C:\Users\Nibir Hira\go\src\github.com\hyperledg
er\fabric-samples\fabcar\javascript\node_modules\fabric-ca-client\lib\FabricCACl
ient.js:487:12)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at Socket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:64:8)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to enroll admin user "admin": Error: Calling enrollment endpoint failed w
ith error [Error: connect ECONNREFUSED 127.0.0.1:7054]
Where should I do corrections? The file registeradmin.js is not even working
Here is a solution for Hyperledger Fabric v2.x. The problem is port no: 7054 is missing in test network.
In Linux (try if it works in virtual box), one way to solve is fresh restart from fabcar folder (not test network folder) then run again.
cd $HOME/fabric-samples/fabcar
./startFabric.sh javascript (by default it's goLang)
A fresh restart of the network will occur as "startFabric.sh" contains network up, down, chaincode installing, all in one.
Now try again:
node enrollAdmin.js
Worked for me.
Extra: Now you can run node registerUser.js and node invoke.js if you were about to use invoke.js .
Your node application cannot connect to the Fabric CA server running in the container - so either it is not running, has failed or possibly you have some firewall or other connectivity problem.
You can test connectivity by using wget or curl or a browser to hit this URL - http://localhost:7054/api/v1/cainfo and until you can hit this URL your enrollAdmin program will fail.
I don't use windows, but docker ps on Linux would tell me if the ca container was running, and docker logs ca.example.com would give me the log of the ca container (assuming you are running the fabcar sample on the basic sample network.)
I had the exact same problem. This worked for me:
Open VirtualBox Manager and select the “default” VM
Click “Settings”, “Network”, “Advanced”, “Port Forwarding”.
Create a new rule by clicking the “+” sign on the right and entering the following: Name -> “ca”, Host Port -> 7054, Guest Port -> 7054.
You can leave the Host IP and Guest IP unspecified.
Source:
https://developer.ibm.com/opentech/2017/11/29/running-hyperledger-fabric-windows-revised/

How can I resolve, if EAI_AGAIN error happens on facebook messenger platform?

Our Node.js app for facebook messenger platform threw the following error.
We use "request" module to connect to facebook graph api and the module threw this error. And the problem was resolved without doing anything about 1 hour after I found the problem. So now it's working, but I'm afraid when it'll happen again. Could you teach me this problem and if there is any resolution?
{ Error: getaddrinfo EAI_AGAIN graph.facebook.com:443
at Object.exports._errnoException (util.js:949:11)
at errnoException (dns.js:33:15)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:79:26)
code: 'EAI_AGAIN',
errno: 'EAI_AGAIN',
syscall: 'getaddrinfo',
hostname: 'graph.facebook.com',
host: 'graph.facebook.com',
port: 443 }
Short answer:
This happens when you have lost connection to your DNS server or the DNS settings are wrong (this includes, but is not limited to, complete or partial disconnect from internet).
That is: Please check if your cable or WiFi connection OR your internet provider does not have a (temporary) problem.
Details:
When this happened, I could see in the debugger call stack that the system function getaddrinfo fails. Thus, it seemed like the trivial reason was - the system cannot map the host name to an IP (in your case the host name 'graph.facebook.com" could not be found).
Indeed, when I tried to ping the host name, which I wanted to reach I got the same as ping error like pinging an unknown host:
u#h:~$ ping someunknownhost.xyzdomain
ping: unknown host someunknownhost.xyzdomain
Additionally when, my connectivity to internet recovered and I could ping the host then the problem of node.js also disappeared.

Resources