[Update] Installing and Running node.js applications within IIS on Windows – Are you mad? | bat remote desktop trong win 10

bat remote desktop trong win 10: You are currently viewing the topic.

Some folks on our đội nhóm have been working on making node.js work awesomely on Windows. There’s a few questions you might have.

First, what’s node.js?

If you’re not familiar with node.js, it’s a new website programming toolkit that everyone’s talking about. It’s the one that makes you feel not hip if you don’t know what it is. Like Ruby on Rails was a few years back. Folks called it “Node” and it’s basically server-side JavaScript. The idea is that if you are doing a bunch of JavaScript on the client and you do JavaScript all day, why not do some JavaScript on the server also. One less thing to learn, I suppose.

If you are an ASP.NET programmer, you can think of node.js as being like an IHttpHandler written in JavaScript. For now, it’s pretty low-level. It’s NOT an HttpHandler, but I’m using an analogy here, OK? Here’s a lovely article by Brett McLaughlin that goes into more detail about Node.js and what it is. His subtitle is “Node isn’t always the solution, but it does solve some important problems” and that’s just exactly it.

UPDATE 1: Why does node.js matter?

Why bother with node at all? There’s a number of interesting aspects to node as it sits. It uses a very fast JavaScript engine called V8, but more importantly its I/O is asynchronous and sự kiện-driven which contrasts with typical synchronous code.

For example, a naive hello world HttpHandler in ASP.NET that “does some work” for a few seconds (gets a file, accesses a service, etc) could look something like this:

And this is usually fine for most stuff. However, when I push this HARD with a load testing tool and a thousand virtual clients, I can barely get 60 requests a second. The request thread is tied up waiting for the “work” to happen and everyone else gets in line. I’m using up ASP.NET pool. It’d be nice if the work would get handled and someone would “call me back” when it’s finished. It’s like waiting on hold for tech support. You are effectively blocked as you wait for them to pick up their end. Wouldn’t it be nice if they just called you back when they were ready?

ASP.NET has always been able to do things (see this MSDN article from 2003 on Async Handlers) with IHttpAsyncHandler but it’s always been a bit hard and almost no one knows about it. With the Async CTP and the Task libraries built into .NET, you can build a nicer abstraction on top of IHttpAsyncHandler. Ayende has a simple example AbstractAsyncHandler (there’s many of these out there, including a few in our own tools, some things in MVC, and some things in SignalR (more on that soon)) that we can use to do similar work. This example could also do other more complex and pertinent things like file IO, db IO or calling a website service. This is a naive example that doesn’t map exactly to the node one below, but it makes the point. + Plus, it’s nice to look at.

Pointing the same 1000 virtual clients at this handler gives me 500 requests a second, which makes sense as a request takes 2 seconds to finish. If we were doing I/O or other more complex and long running things than waiting, this scales better than the first example. Doing asynchronous code in .NET as well as parallelism is much easier than before, as evidenced by the two lines of  code above and the simplicity of Ayende’s small example. The fact that this kind of thing is easy and elegant in node is an attractive thing about node.

Node loves asynchrony, and uses JavaScript callbacks to provide asynchrony in a pleasant way. You use events and callbacks in JavaScript already on the client, why not use them on the server? Here’s an example from Marc Fasel’s blog on the topic.

First, some synchronous file work via Marc:

And the same work using an asynchronous pattern that may look familiar!

The I/O happens and the callback function that’s dependant on the result is executed when the I/O is finished. Powerful stuff.

Xem Thêm  McAfee VS AVG: Which Is Better? See a Comparison Now!

Why would I want node.js to run on Windows and IIS?

Tomasz Janczuk is working on the iisnode project lately. You might think that Windows and node don’t belong together. “That’s just wrong! What are they thinking? I thought IIS was all about .NET?” Well, you may recall I spoke at CodeMash a few years back on IIS7 and PHP and did a screencast showing how IIS7, PHP and FastCGI could push many thousands of requests a second. The IIS folks, the Windows folks, the Azure folks, want to make sure everything runs well on Windows. Remember, we sell Windows, so it’s good if it does many things well. 😉

Why bother getting node to run on IIS? Tomasz says it best:

Some of the advantages of host node.js applications in IIS using the iisnode module as opposed to self-host node.exe processes include:

  • Process management. The iisnode module takes care of lifetime management of node.exe processes making it simple to improve overall reliability. You don’t have to implement infrastructure to start, stop, and monitor the processes.
  • Scalability on multi-core servers. Since node.exe is a single threaded process, it only scales to one Chip xử lý core. The iisnode module allows creation of multiple node.exe processes per application and load balances the HTTP lượt truy cập between them, therefore enabling full utilization of a server’s Chip xử lý capacity without requiring additional infrastructure code from an application developer.
  • Tự động-cập nhật. The iisnode module ensures that whenever the node.js application is updated (i.e. the script file has changed), the node.exe processes are recycled. Ongoing requests are allowed to gracefully finish execution using the old version of the application, while all new requests are dispatched to the new version of the app.
  • Access to logs over HTTP. The iisnode module provides access the output of the node.exe process (e.g. generated by console.log calls) via HTTP. This facility is key in helping you debug node.js applications deployed to remote servers.
  • Side by side with other content types. The iisnode module integrates with IIS in a way that allows a single website site to contain a variety of content types. For example, a single site can contain a node.js application, static HTML and JavaScript files, PHP applications, and ASP.NET applications. This enables choosing the best tools for the job at hand as well progressive migration of existing applications.
  • Minimal changes to node.js application code. The iisnode module enables host of existing HTTP node.js applications with very minimal changes. Typically all that is required is to change the listed address of the HTTP server to one provided by the iisnode module via the process.env.PORT environment variable.
  • Integrated management experience. The issnode module is fully integrated with IIS configuration system and uses the same tools and mechanism as other IIS components for configuration and maintenance.

    In addition to benefits specific to the iisnode module, host node.js applications in IIS allows the developer to benefit from a range of IIS features, among them:

    • port sharing (host multiple HTTP applications over port 80)
    • security (HTTPS, authentication and authorization)
    • URL rewriting
    • compression
    • caching
    • logging

These are all compelling, but the most interesting bit here, in my opinion, is integration. The iisnode module is a proper IIS module, just like ASP.NET and PHP. This means you can have a single trang web that has multiple kinds of content. Restated from above:

For example, a single site can contain a node.js application, static HTML and JavaScript files, PHP applications, and ASP.NET applications.

Sometimes folks freak out when I say you can have an ASP.NET WebForms app and a ASP.NET MVC app in the same AppPool as a “hybrid.” Frankly, Dear Reader, people don’t even realize the power and flexibility of IIS. When you plug in something new like node but run it the way you run other things it inherits all the coolness of the outer container, in this case, IIS.

Fine, you got me, how do I run node.js on Windows?

I’m assuming you are running IIS7.

  • Go download node.exe, and put it in c:node
  • Go download a build of iisnode.
  • Unzip iisnode’s zip into inetpubiisnode
    • (that was my idea, not sure if it’s the best place)
  • From an Administrator Command Line, run install.bat.
Xem Thêm  Cách tải nhạc vào USB, thẻ nhớ đơn giản ai cũng làm được - tai nhac về thẻ nhớ

The install.bat will:

  • unregister existing “iisnode” global module from your installation of IIS if such registration exists
  • register iisnode as a native module with your installation of IIS
  • install configuration schema for the “iisnode” module
  • remove existing “iisnode” section from system.webServer section group in applicationHost.config
  • add the “iisnode” section within the system.webServer section group in applicationHost.config
  • delete the iisnode website application if it exists
  • add a new site iisnode to IIS

No warranties! Be careful, you’re living on the edge. Remember, you’re reading this stuff on some random dude’s blog.

WARNING: I couldn’t figure out the right permissions for the AppPool and the File System so I wimped out and gave my local AppPool “SYSTEM” permissions. This is awful and totally my fault. I filed an issue on the iisnode GitHub and I’ll fix it and cập nhật this bài viết when I hear back.

I made a new AppPool just for node, gave it SYSTEM access, then assigned the Node Site to this new AppPool. Your site should look like:

And if you click on Modules for this Site in IIS7 you should see iisnode as a native module:

Hey, it's iisnode as a native module, just like I said. Crazy.

At this point, you should be able to hit http://localhost/node/helloworld/hello.js and get back:

Hello, world! [helloworld sample]

The contents of which are simply:


Fooling around with WCAT (Website Capacity Analysis Tool) and node.

Disclaimer: To be clear, this is so very fooling around. This is just to show that it works and it can do the basics really fast. I’m not doing a benchmark nor am I saying “this works better than this other thing.” Remember, they just got started recently porting node itself to Windows, and Tomasz and friends are just beginning their work. So, don’t overreach. That said, the preliminary work they are doing is really impressive.

I couldn’t help myself. I mean, it’s one thing to install a helloworld of some new thing, run it once and go “OK, that runs.” It’s another to pound it until it says “Uncle.” After I got the hello world stuff working, I wanted to do some poor man’s mệt mỏi testing to see what the players involved did.

First, I installed WCAT, a free Website Capacity Analysis Tool from the IIS đội nhóm.

Warning. This is a command-line only tool and it’s really persnickety when you run it. It’s confusing and it took me a minute to cài đặt.  Here’s the steps I took after installing. This is all from an Administrator Command Prompt. chú ý also that I’m doing this all on one machine, which is cheesy, but remember, it is a GOM.

  1. cscript //H:Cscript
  2. wcat.wsf –terminate –cập nhật –clients localhost
  3. Then I made a folder I called nodetests and I put these three files in it:


pushd C:UsersScottDesktopnodetests
"c:program fileswcatwcat.wsf" -terminate -run -clients localhost -f settings.ubr -t nodescenario.ubr -s localhost -singleip -o C:UsersScottDesktopnodetests

nodescenario.ubr (or call it whatever you want)

This is so basic. It just beats on the four sample applications for a while.


I just copied in the one from samples and uncommented out and changed (and tweaked during testing) these lines:

Now, run the Check

Next, I ran wcat.bat as an Administrator…you can see all the little node.exe’s firing up. I’ve got a

(Remember they are running as SYSTEM because I was unable to figure out the right permissions. That’s my bad, no one else’s. I’ll figure it out one day.)

Here’s the WCAT tool’s console output…I’m able to consistently do 10,000 hello worlds a second and ended up with just under a million normal requests and responses in 90 seconds. That’s a lot of hello worlds.

Remember Hanselman’s Rule of Scale.

“If you do nothing, you can scale infinitely.” – Me

Of course, this is all local on a fast machine. This is just hello world (with some logging) so it’s not testing node much, nor IIS much, but rather the collaboration between the whole system, IIS, iisnode, and node itself.

Aside: an ASP.NET IHttpHandler doing the exact same thing on this same machine gets 22,500 requests a second, so node and iisnode has some room to improve, which is great.

Here’s the node/iisnode results:

Xem Thêm  [Update] 1000 Từ vựng tiếng Anh thông dụng theo chủ đề | từ vựng tiếng anh thông dụng - Xác minh

There’s a lot of things I could configure on both sites, number of clients, virtual clients, as well as iisnode-specific settings (which are, nicely enough, managed in a website.config:

This is pretty cool stuff. I like that the đội nhóm I work with is excited to make things work well on IIS and I’m stoked that I can mess around with node now without firing up VMs. I’ll report back as I learn more!

Related Links

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

About   Newsletter
Host By

(Solved) Remote Desktop Can´t Kết nối to The Remote Computer for one of These Reasons in Windows 10

How to Resolve Remote Desktop Can´t Kết nối to The Remote Computer for one of These Reasons.
1. Verify Network Details
2. Turn Off the Windows Firewall
3. Enable Remote Desktop Connection
4. Test the RDP Services
5. Enable Network Discovery Feature
How To Fix Enter Network Credentials Error on Windows 10: https://youtu.be/5auAzdeVy6I
How To Fix Remote Desktop Can’t Find the Computer on Windows 10: https://youtu.be/Wa85TjyPhXs
See more:
Create Payoneer Tài khoản Get 25$ on Payoneer Now: https://youtu.be/eVUKK9NlR0
How to install Ubuntu on Virtualbox in Windows 10: https://youtu.be/OMS8bGEGWA8

In addition to looking at this article You can also see other useful information. Many more we provide here: See more knowledge here.

(Solved) Remote Desktop Can´t Connect to The Remote Computer for one of These Reasons in Windows 10

Cấu hình điều khiển từ xa cho windows – How to configure remote desktop control


Cấu hình laptop để điều khiển từ xa phục vụ Work From Home

Cấu hình điều khiển từ xa cho windows   -   How to configure remote desktop control

Chỉ dẫn cấu hình Remote Desktop win 10 & mở port trên modem | 100 user truy cập RD bằng 1 ip wan

Chỉ dẫn cấu hình Remote Desktop windows 10 & mở port 3389 trên modem để điều khiển laptop từ xa. Nhiều user connect Remote desktop cùng 1 thời điểm qua 1 địa chỉ ip wan.
☛ Đường dẫn biến đổi port RD: HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal ServerWinStationsRDPTcp
☛ Setup mỗi tầng một cái wifi connect từ Wifi chính VNPT/FPT: https://youtu.be/SHx3oa9ew4
☛ Tạo usb boot windows 10 phiên bản 1909: https://youtu.be/cKnLcuzluSU
☛ Chỉ dẫn seting windows 10 version 1909 tận nhà: https://youtu.be/oXX_nWjBsHE
☛ Seting driver windows 10 bằng một click: https://youtu.be/6290SW78jRU
☛ Tạo nhiều laptop ảo windows 10 bằng PM VM VirtualBox: https://youtu.be/wFbtuk8OITo
Kênh Khám phá Kênh chia sẻ tri thức & gắn bó với các bạn về ngành nghề: Khoa học, công nghệ, kiếm tiền online, sức khỏe, bí quyết để thành công, những mẹo kinh doanh hiệu quả & chia sẻ những kinh nghiệm & tri thức mà tìm tòi hiểu rằng.
Liên hệ & suport:
☛ ĐĂNG KÝ KÊNH tại backlink: http://bit.ly/2WU240y
☛ Toàn bộ video kênh tìm tòi: http://bit.ly/3pz06P8
☛ Fb: https://www.facebook.com/JohnnyTran2402
☛ Trang web: www.congngheinternet.com
☛ Tin nhắn hộp thư online: sontranit1990@gmail.com

remotedesktop RD remote windows10 moport modem ipwan truycapremotedesktop kenhtimhieu

Hướng dẫn cấu hình Remote Desktop win 10 và mở port trên modem | 100 user truy cập RD bằng 1 ip wan

Cách mở remote desktop Win 10 | | Kênh Học Thêm

Kenhhocthem vULTR
Cách mở remote desktop Win 10,
Mở remote desktop,
☞ Hãy phản hồi khúc mắc phía dưới
? Đăng ký Kênh Học Thêm nhé ?
☞ https://bit.ly/KenhHocThem

Cách mở remote desktop Win 10 |  | Kênh Học Thêm

How to use Remote Desktop – Mac to Windows

Microsoft Remote Desktop for MacOS
VPN for MacOS
How to find your Hostname on Windows
NMSU College of Engineering IT

How to use Remote Desktop - Mac to Windows

In addition to looking at this article You can also see other useful information. Many more we provide here: See more articles in the category.tips/

Thank you very much for viewing the bài viết topic. bat remote desktop trong win 10

Trả lời