onmodulus/aws-sqs — pull request #11 by patricklodder (2013-04-29 09:44:00+00:00)
Title: Allow alternate endpoints for backward compatibility

This fixes issue #4 by adding a bool option to the `SQS` constructor, `opts.altEndPoint`.

If `opts.altEndPoint` is truthy:
- the alternate sqs hostname pattern `[region.]queue.amazonaws.com` will be used

If `opts.altEndPoint` is falsy (=or omitted) :
- the current hostname pattern `sqs.[region].amazonaws.com` will be used.

See http://docs.aws.amazon.com/AWSSimpleQueueService/2009-02-01/SQSDeveloperGuide/index.html?endpoints.html for details.

I have ran the test suite against all current regions, and it works for all of them, including `ap-northeast-1` and `us-west-2`, which are undocumented in the url above.

Please note that you can always mix usage of endpoints, eg: you can delete a or send messages to a queue over the alternate endpoint hostname that was created using the current endpoint hostname.