Comments (7)
You can do it programatically. See an example here.
from toxy.
I was able to get the example to proxy httpbin.org. I am trying to proxy s3.amazonaws.com with this code:
var fs = require('fs')
var toxy = require('toxy')
var opts = {
ssl: {
key: fs.readFileSync('server.key', 'utf8'),
cert: fs.readFileSync('server.crt', 'utf8')
}
}
var proxy = toxy(opts)
// Forward to HTTPS server
proxy
.get('/*')
.option({ secure: false })
.host('s3.amazonaws.com')
.forward('https://s3.amazonaws.com')
proxy.listen(443)
console.log('HTTPS toxy-proxy listening on port: ', 443)
but then run into this problem (my .boto redirects to localhost and 443)
python s3-boto-test.py
Traceback (most recent call last):
File "s3-boto-test.py", line 7, in
b = conn.create_bucket(bucket_name)
File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 612, in create_bucket
data=data)
File "/usr/local/lib/python2.7/site-packages/boto/s3/connection.py", line 664, in make_request
retry_handler=retry_handler
File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 1071, in make_request
retry_handler=retry_handler)
File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 913, in _mexe
self.is_secure)
File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 705, in get_http_connection
return self.new_http_connection(host, port, is_secure)
File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 747, in new_http_connection
connection = self.proxy_ssl(host, is_secure and 443 or 80)
File "/usr/local/lib/python2.7/site-packages/boto/connection.py", line 792, in proxy_ssl
int(self.proxy_port)), timeout)
File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
socket.error: [Errno 61] Connection refused
I don't understand the option yet, so will permutate that in the mean time.
from toxy.
Seems like the server is replying with a Location
header. I would recommend you to test it directly from another HTTP client (like your browser) in order to determine where is the origin of the issue.
from toxy.
Closing for now due to inactivity.
from toxy.
I am seeing this error too, don't close.
from toxy.
I am getting the same issue. I could not understand what you suggested above. can you please explain it.
from toxy.
@h2non is saying that you should see if the browser can connect to the server without toxy, as the server may be the problem, not toxy. In other words, eliminate other possible contributing factors.
from toxy.
Related Issues (20)
- slowRead problems when submitting files larger then 30KB HOT 2
- Need some hand holding... HOT 2
- Having issues with Node 4.5.0 after updating from 0.12.5 HOT 9
- Forward to IP no to a host and preserve host header HOT 1
- Odd self signed certificate JSON payload
- http OPTIONS req returns 502 bad gateway from rocky server HOT 1
- Forward all HOT 4
- MaxListenersExceededWarning when trying to update poison on the proxy HOT 6
- HTTP API is unable to handle CORS preflight requests HOT 2
- Strict Forwarding and Websockets
- Unable to delete outgoing poisons via HTTP API HOT 1
- Toxy is awesome, but obscure. Needs a kick ass example. HOT 1
- Network throttling in iOS app programatically for automation. HOT 11
- How to allow the entire network traffic via proxy port by not filtering via certain urls?
- Relative forward
- Relative forward? HOT 1
- How to use behind a corporate proxy?
- Can toxy be used as a web browser proxy? HOT 1
- Nothing works on Node 16 HOT 4
- How to use timeout poison?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toxy.