npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

arcgis-resource-proxy

v0.1.5

Published

ArcGIS Resource Proxy

Readme

node.js ArcGIS Proxy Server

This is an implementation of an ArcGIS proxy server using node.js. While this server can proxy most http requests, it is specifically designed to act on behalf of ArcGIS type services following the ArcGIS Resource Proxy specification. The proxy handles support for:

  • Accessing cross domain resources.
  • URL transformations.
  • Requests that exceed 2048 characters.
  • Accessing resources secured with ArcGIS token based authentication.
  • Accessing resources secured with OAuth 2.0 app login.
  • Transaction logging.
  • Resource based rate limiting to help manage credit consumption.

Instructions

npm install
  • Edit the proxy configuration file:
    • Choose either one of (conf/config.json or conf/config.xml, but not both) configuration format.
    • Use a text editor to set up your proxy configuration settings.
    • Decide which port your server should listen on (default is 3692).
    • Determine which URLs you are going to proxy by editing the serverUrls section.
    • Set your allowedReferrers. While "*" may be ok for testing we highly recommend whitelisting referrers in production.
    • Review the full documentation for proxy configuration settings.
  • Start the node server from a command line:
npm start
  • Test that the proxy is installed and available by running a browser on the local machine then navigate to the port and url:
http://localhost:{port}/ping
  • Test that the proxy is able to forward requests directly in the browser using one of your serverUrls definitions, such as:
http://localhost:{port}/proxy/http/services.arcgisonline.com/ArcGIS/rest/services/?f=pjson
  • Check the current status of your proxy server:
http://localhost:{port}/status

Once you deploy to an infrastructure on the public internet replace localhost with the host name you install the proxy server on.

Requirements

  • node.js version 6.0 or higher (recommended.)
  • sudo access rights so you can install files, open a TCP/IP port.
  • File access read/write access for the log file and the sqlite database.
  • Server administration and networking background to securely run your server.

Folders and Files

The proxy consists of the following files:

  • package.json: the node configuration.
  • conf/config.json: This file contains the configuration settings for the proxy. This is where you define all the resources that are allowed to use the proxy.
  • conf/config.xml: This file contains the configuration settings for the proxy. This is where you define all the resources that are allowed to use the proxy.
  • node_modules/: after you run npm install this folder holds all the node dependencies.
  • bin/: folder containing the proxy runtime scripts.

Running your proxy server

Follow these instructions to setup and operate your proxy server.

Logging

The proxy server can log to the console, a log file, or both. There are 4 levels of logging:

  1. Errors: only log error conditions. Errors typically indicate normal functionality that has failed and should be addressed.
  2. Warnings: show warnings and error conditions in the log. Warnings are soft errors that may require intervention.
  3. Information: show informational messages, warnings, and errors. Information messages are useful for debugging your server setup.
  4. None: show no log messages.

You can configure the log file name and path to where it should go on your server.

Example Configurations

The node proxy supports JSON and XML configuration. Sample configurations are located in the /conf folder.

If you change the configuration file you must restart the server.

Requests

To properly use this proxy server in a secure manner you must white-list all requests. See the documentation regarding allowedReferrers. The samples use * because we don't know where you are calling the proxy server from, but this is very dangerous. Do not deploy to production without white-listing allowed referrers or you could end up proxying nefarious requests.

Rate Limiting

You can set up rate limits on your proxied resources. This is the rate a resource may be accessed within the given time period for all referrers (requests). For example, a rateLimit of 120 requests within a rateLimitPeriod of 60 minutes specifies no more than 120 requests over the course of 1 hour, or 2 requests per minute. This is a sliding time window from the first request. Once the limit is reached access will not be granted until the next time interval.

Issues

Found a bug or want to request a new feature? Check out previously logged Issues and/or our FAQ. If you don't see what you're looking for, feel free to submit a new issue.

Contributing

Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.

License

Copyright 2017 Esri

Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for specific language governing permissions and limitations under the license.