{"id":23046657,"url":"https://github.com/esri-es/arcgis_websocket_server","last_synced_at":"2025-08-15T00:33:33.645Z","repository":{"id":42351184,"uuid":"173737021","full_name":"esri-es/arcgis_websocket_server","owner":"esri-es","description":"A NodeJS websocket server compatible with StreamLayer (ArcGIS API for JavaScript)","archived":false,"fork":false,"pushed_at":"2024-12-06T07:38:23.000Z","size":464,"stargazers_count":17,"open_issues_count":7,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T04:41:28.319Z","etag":null,"topics":["arcgis","esri","geolocation","iot","javascript","realtime","websocket-server","websockets"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esri-es.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-04T12:02:11.000Z","updated_at":"2024-05-02T17:04:44.000Z","dependencies_parsed_at":"2022-09-14T14:01:18.864Z","dependency_job_id":null,"html_url":"https://github.com/esri-es/arcgis_websocket_server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/esri-es/arcgis_websocket_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esri-es%2Farcgis_websocket_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esri-es%2Farcgis_websocket_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esri-es%2Farcgis_websocket_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esri-es%2Farcgis_websocket_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esri-es","download_url":"https://codeload.github.com/esri-es/arcgis_websocket_server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esri-es%2Farcgis_websocket_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270505606,"owners_count":24596501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-14T02:00:10.309Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcgis","esri","geolocation","iot","javascript","realtime","websocket-server","websockets"],"created_at":"2024-12-15T22:28:43.769Z","updated_at":"2025-08-15T00:33:33.330Z","avatar_url":"https://github.com/esri-es.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArcGIS WebSocket Server\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Start the app](#start-the-app)\n  - [Using HTTPS (NGROK)](#using-https-ngrok)\n- [Known issues](#known-issues)\n  - [ArcGIS API for JavaScript version \u003c= v4.8 \u0026 v3.x](#arcgis-api-for-javascript-version--v48--v3x)\n- [Additional documentation](#additional-documentation)\n- [Talk: Geolocating tweets in real time (in Spanish)](#talk-geolocating-tweets-in-real-time-in-spanish)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\nThis node server behaves as a [GeoEvent](https://www.esri.com/en-us/arcgis/products/arcgis-geoevent-server) [StreamServer](https://developers.arcgis.com/rest/services-reference/stream-service.htm) layer, so it will emit geographic features in the [Esri JSON](https://developers.arcgis.com/documentation/common-data-types/feature-object.htm) format though a [WebSocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). This way we will be able to display a real time layer in ArcGIS without an [ArcGIS Enterprise](https://www.esri.com/en-us/arcgis/products/arcgis-enterprise/overview) stack.\n\n![custom websocket server in arcgis](https://user-images.githubusercontent.com/826965/53808519-bc44bb80-3f52-11e9-9635-8687d5046bc4.gif)\n\nIt can be used with any [ArcGIS developer technology](https://developers.arcgis.com/documentation/#sdks) or [any other product](https://esri-es.github.io/awesome-arcgis/arcgis/products/). For example add the StreamServer to a [webmap](https://esri-es.github.io/awesome-arcgis/esri/open-vision/open-specifications/web-map/) and visualize it in Operations Dashboard, ArcGIS Pro, any Storymap, etc.\n\n## Start the app\n\n\u003e *We are assuming you are familiar with NodeJS, if you are not please [read this first](https://nodejs.org/en/docs/guides/getting-started-guide/)*\n\n1. Check [init.js](https://github.com/esri-es/arcgis_websocket_server/blob/feature/dynamic_service/init.js#L4) and fill in **SERVICE_CONF** object properly.\n\n```js\nconst SERVICE_CONF = {\n  name : \"twitter\",\n  out_sr : {\n    wkid : 102100,\n    latestWkid : 3857\n  },\n  port : 9000,\n  host : process.env[\"NGROK\"]  || \"localhost\",\n  protocol : process.env[\"NGROK\"] ? \"https\" : \"http\"\n};\n```\n\n\u003e Be aware of the **name : \"twitter\"**. It will be propagated below, in the instructions. If you want to use othe name, change it also along the instructions.\n\n2. Start the real time server: `node init.js \"ws://localhost:8888\" \"4.11\"`\n\n\u003e In this example **ws://localhost:8888** is the websocket connection we want to consume data from. This websocket connection it's not the same as the one which will be exposed by **StreamServer**. But don't worry, all will be wired up (luckily)\n\n\u003e It will check the **websocket** connection first. If it's any problem, it will notice it, and it will warn you :-)\n\n\u003e If it's able to connect, it \"automagically\" set the fields for your **StreamServer** according to the payload received in the websocket connection attempted before.\n\n3. Start a web server: `cd example \u0026 http-server -p 9090`\n4. Open: [http://localhost:9090/](http://localhost:9090/)\n1. Stream service url: `http://localhost:9000/arcgis/rest/services/twitter/StreamServer`\n\n### Using HTTPS (NGROK)\n\nIf you want to test this from the [sandbox sample](https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=layers-streamlayer) you can also use [ngrok](https://ngrok.com/)\n\n1) Run: `ngrok http 9000`\n2) Stop init.js and run `NGROK=yourid.ngrok.io node init.js \"ws://localhost:8888\" \"4.11\"`\n3) Use: `https://yourid.ngrok.io/arcgis/rest/services/twitter/StreamServer` instead of `http://localhost:9000/arcgis/rest/services/twitter/StreamServer`\n\n## Known issues\n\n### ArcGIS API for JavaScript version \u003c= v4.8 \u0026 v3.x\n\n\u003e UPDATE : Working in a version which can handle any version! Cross your fingers!\n\nBefore [this commit](https://github.com/hhkaos/arcgis_websocket_server/commit/22c48299d92e7761e6c718d2c6afa525284fc448) on May 5, 2015 this streamserver was only working with JS API \u003c= v4.8 and v3.x. If you want to know more you can also [check this issue](https://github.com/hhkaos/arcgis_websocket_server/issues/3).\n\n## Additional documentation\n\n* [ArcGIS Server \u003e Stream services](http://enterprise.arcgis.com/en/server/latest/publish-services/linux/stream-services.htm)\n* [ArcGIS REST API \u003e StreamServices](https://developers.arcgis.com/rest/services-reference/stream-service.htm)\n* [Awesome ArcGIS \u003e GeoEvent Server](https://esri-es.github.io/awesome-arcgis/arcgis/products/arcgis-enterprise/arcgis-server/geoevent-server/)\n* [Awesome ArcGIS \u003e Internet of things (IoT) \u0026 Real-time (RT)](https://esri-es.github.io/awesome-arcgis/esri/emerging-technologies/iot-rt/?)\n* [Public stream services in ArcGIS Online](https://esri-es.github.io/arcgis-developer-tips-and-tricks/arcgis-online/search/?q=typekeywords%3A%22stream+service%22\u0026numResults=100\u0026sortField=relevance\u0026Thumbnail=generateThumbnail(elem)\u0026Title=elem.title\u0026Details=%27%3Ca+href%3D%22https%3A%2F%2Fwww.arcgis.com%2Fhome%2Fitem.html%3Fid%3D%27%2Belem.id%2B%27%22+target%3D%22_blank%22%3EDetails%3C%2Fa%3E%27\u0026Owner=elem.owner\u0026Type=elem.type\u0026Views=elem.numViews)\n  * [Preview several Stream Services simultaneously in a Web Map](http://www.arcgis.com/home/webmap/viewer.html?webmap=55a55a4c08934ba890f7fbd5589cffe6)\n* [Pubnub \u0026 Esri](https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi)\n  * [Mapping and Tracking that Your Users Crave](https://www.youtube.com/watch?v=VWoXSJWgwrU)\n  * [Esri DevSummit 2017 Keynote: PubNub CEO Todd Greene](https://www.youtube.com/watch?v=yrbODI7cuAk)\n* [Search more about \"Stream services\"](https://esri-es.github.io/arcgis-search/?amp%3Butm_source=opensearch\u0026search=%22Stream+services%22)\n\n## Talk: Geolocating tweets in real time (in Spanish)\n\nEn la charla [Geolocalizando tweets en tiempo real](http://slides.com/hhkaos/geolocalizando-tweets#/) del día día 24 de Julio de 2019 se explicó:\n\n* Objetivos y resultados del experimento\n* Cómo lanzar el proyecto\n* Demo: Cargar los tweets en una StreamLayer\n* Demo: Cargar los tweets en un Web map\n* Demo: Cargar los tweets con gráficar en tº real\n* Diagrama del comportamiento de [twitter-rt-service](https://github.com/esri-es/twitter-rt-service)\n* Mejoras pendientes en [twitter-rt-service](https://github.com/esri-es/twitter-rt-service)\n* Diagrama del comportamiento de [arcgis_websocket_server](https://github.com/esri-es/arcgis_websocket_server)\n* Mejoras pendientes en [arcgis_websocket_server](https://github.com/esri-es/arcgis_websocket_server)\n* Estructura de ficheros del proyecto: [twitter-rt-service](https://github.com/esri-es/twitter-rt-service)\n* Explicación del código: [twitter-rt-service](https://github.com/esri-es/twitter-rt-service)\n* Estructura de ficheros del proyecto: [arcgis_websocket_server](https://github.com/esri-es/arcgis_websocket_server)\n* Explicación del código: [arcgis_websocket_server](https://github.com/esri-es/arcgis_websocket_server)\n* Despedida, preguntas y agracedimientos\n\nA continuación puede encontrar el vídeo en Youtube con un índice interactivo en la descripción del vídeo:\n\n[![](http://i3.ytimg.com/vi/PeTzi-ficFo/hqdefault.jpg)](https://www.youtube.com/watch?v=PeTzi-ficFo)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesri-es%2Farcgis_websocket_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesri-es%2Farcgis_websocket_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesri-es%2Farcgis_websocket_server/lists"}