Kayıtlar

node etiketine sahip yayınlar gösteriliyor

Change desktop resolution with node.js FFI

I use my desktop workstation as a home-server of sorts. It is great to game in the comfort of your living room, on the TV, with your favorite game pad if you have an Apple TV (or any other compatible device). This is possible using a variety of software; Steam Link , Rainway or if you have an NVIDIA GPU using the open source streaming alternative Moonlight . There is a problem though: I have an ultra-wide monitor which does not play well with some game/streaming app combinations. It forces you to switch the game between fullscreen and windowed modes when you are on the actual terminal vs remote.

Simple Proxy Server Using Node.js to Bypass CORS

Node.js is a javascript runtime based on Chromium’s V8 javascript engine. It is really simple to create a basic HTTP server using the node.js API and a web based proxy is just an HTTP server that relays incoming requests back to the original recipient. So we will capture the requests and forward them using a an http.request. There are already programs to be used as debugging proxies (such as Charles, Fiddler, mitmproxy) but they are often limited and it is hard/complicated when it comes to composing a little bit complicated rules. For example once I needed a simple rule that repeats the origin of the orginal request in the proxied response to be able to circumvent CORS restrictions whentesting a web application. Sometimesit is easier to write a little bit of javascript code if you know how. #!/usr/bin/env node//Import the http modulevar http = require("http");//Create the server listening on port 8888http.createServer(function(request, response) {//Log the URL for debugging e...