Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9101755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:12:45+00:00 2026-06-17T01:12:45+00:00

So I set up an ejabberd XMPP server and use nginx as a proxy

  • 0

So I set up an ejabberd XMPP server and use nginx as a proxy on an EC2 instance. The Strophe.js echobot example can connect from my Chrome browser. Here are the Request Headers:

Request URL:http://foo.eu-west-1.compute.amazonaws.com/http-bind
Request Method:POST
Status Code:200 OK
Request Headers
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
Connection:keep-alive
Content-Length:115
Content-Type:application/xml
Host:foo.compute.amazonaws.com
Origin:foo.eu-west-1.compute.amazonaws.com
Referer:foo.eu-west-1.compute.amazonaws.com/examples/echobot.html
User-Agent:Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
Request Payload
<body rid='2692151172' xmlns='http://jabber.org/protocol/httpbind' sid='15f6dc6cbc7a7d69b5db531c2ebf7828e094f043'/>
Response Headers
Access-Control-Allow-Headers:Content-Type
Access-Control-Allow-Origin:*
Connection:keep-alive
Content-Length:286
Content-Type:text/xml; charset=utf-8
Date:Fri, 04 Jan 2013 11:14:14 GMT
Server:nginx/1.2.4

I ported the echobot example to work in Spotify as an app. However, Strophe cannot connect. Here is the Web Inspector network log:

Request URL:http://foo.eu-west-1.compute.amazonaws.com/http-bind
Request Headers
POST http://foo.eu-west-1.compute.amazonaws.com/http-bind HTTP/1.1
Origin: sp://chatify
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.15 Safari/535.11
Content-Type: application/xml
Request Payload
<body rid='790399813' xmlns='http://jabber.org/protocol/httpbind' to='ec2-54-246-45-111.eu-west-1.compute.amazonaws.com' xml:lang='en' wait='60' hold='1' content='text/xml; charset=utf-8' ver='1.6' xmpp:version='1.0' xmlns:xmpp='urn:xmpp:xbosh'/>

Now. The RequiredPermissons in the manifest.json look as follows:

"RequiredPermissons": [
    "http://foo.eu-west-1.compute.amazonaws.com",
    "foo.eu-west-1.compute.amazonaws.com",
    "http://foo.eu-west-1.compute.amazonaws.com/http-bind",
    "foo.eu-west-1.compute.amazonaws.com/http-bind"
]

I can load sources from foo.eu-west-1.compute.amazonaws.com so I think the permissons work.
The Spotify app uses a different origin, “sp://chatify”. I read that this can cause problems. And Access-Control-Allow-Origin:* should be added to the header. I did so in the nginx config just to find out that it had been sent all along. You can see it in Response Headers of the first request.

Strophe.js itself says in the logs of the example if turned on:

error 0 happened

So any suggestions?
The manifest seems to be right
Access-Control-Allow-Origin;* seem right
It works in a browser but not Spotify.

Thx for your help!

Update:
If I open the echobot.html locally it still works. The Origin is then null.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:12:46+00:00Added an answer on June 17, 2026 at 1:12 am

    Okay, I got it to work. And the solution is a classic. However, my debugging might help others.

    1. At first I looked at the Web Inspector. It showed that all request were canceled. No the inspector is not always right as mentioned in many places. This time it was, though.

    2. So Strophe.js could not establish a connection. To see if any custom Spotify App could establish a connection I tried the Google Maps example from the tutorial app. It did not work with the native Linux version and the Windows under wine. It did however work under windows.

    3. My next step was to see if my app could load any resources from the net. So I simply added an iframe: . It did not load my page.

    4. I took a close look at the manifest of the tutorial app and my app. I could not find any difference. So I just copied “RequiredPermissions” to see that I had a typo. Once that was fixed the iframe and eventually strophe.js worked.

    It is funny. I looked for typos a few days ago I could not find any.

    To sum up:

    • Make sure your server sets Access-Control-Allow-Origin;*
    • Set the Permissions. E.g.

      “RequiredPermissions”: [
      “http://ec2-foo.eu-west-1.compute.amazonaws.com”,
      “ec2-foo.eu-west-1.compute.amazonaws.com”,
      “http://ec2-foo.eu-west-1.compute.amazonaws.com/http-bind”,
      “ec2-foo.eu-west-1.compute.amazonaws.com/http-bind”
      ]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a linux server. I installed ejabberd on the server. I can go
I have an ejabberd server at jabber.domain.com, with an xmpp component written in python
I'm trying get online friends by user in XMPP server (Ejabberd). I'm using Ruby
Good people of StackOverflow, please help. I've set up an ejabberd server on my
My current server setup consists of Apache and Ejabberd. Apache acts as a proxy
I installed eJabberd to test my iOS application's XMPP functionality. I can log in
SET @v1 := SELECT COUNT(*) FROM user_rating; SELECT @v1 When I execute this query
SET @Password = ( SELECT UserPassword,IsLocked FROM [Authentication].[tblLogin] WHERE UserName=@UserName) i m trying to
I have two ejabberd servers, one local one distant online on foobar.com. Using xmpp
Set oXMLHttp=Server.CreateObject(MSXML2.XMLHTTP) On Error Resume Next oXMLHttp.open GET, http://xxxxxx.com,False oXMLHttp.setRequestHeader Content-Type, application/x-www-form-urlencoded oXMLHttp.send() x

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.