Username: Password:

Author Topic: Linux proxy for 422 errors.  (Read 18427 times)

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Linux proxy for 422 errors.
« on: June 27, 2017, 02:32:32 PM »
Hi, I've written a free and open source proxy for linux to solve the 422 errors. Hope it helps you.

https://github.com/kevinlekiller/polproxy

Grimdin

  • Guest
Re: Linux proxy for 422 errors.
« Reply #1 on: June 27, 2017, 05:02:23 PM »
Nice. I'm testing it now.

Seems to work. Great work. Not seeing any 422 errors.

It does use lot's of CPU, that would be nice to get down little bit.

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #2 on: June 27, 2017, 05:14:20 PM »
Wow, great job Kevin  :)
I will test it as soon as possible.

Just a question, in the README you say:
Quote
Create a new poloniex api key: https://poloniex.com/apiKeys

Why? Can't use an existing API Key? I'm not sure.
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Grimdin

  • Guest
Re: Linux proxy for 422 errors.
« Reply #3 on: June 27, 2017, 05:28:15 PM »
Wow, great job Kevin  :)
I will test it as soon as possible.

Just a question, in the README you say:
Quote
Create a new poloniex api key: https://poloniex.com/apiKeys

Why? Can't use an existing API Key? I'm not sure.

I am using it using existing API key, works for me.

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #4 on: June 27, 2017, 05:31:05 PM »
Encouter this error:
Code: [Select]
Traceback (most recent call last):
  File "polproxy.py", line 5, in <module>
    from urllib.parse import urlencode
ImportError: No module named parse

Ok, I made:
Code: [Select]
sudo python3 polproxy.pythat solve this error.

But now GB fired me:
Code: [Select]
Creating market client for BTC_BCN pair
Activating hot reconfig...
###[ --2017/06/27 18:34:28--poloniex--BTC_BCN  --  Gunbot v3.3 cycle #1 --------------- ]
::::: collecting market data...
Server running at http://127.0.0.1:39873
(node:5606) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188
      self._callback.apply(self, arguments)
                     ^

TypeError: Cannot read property 'statusCode' of undefined
    at Request._callback (evalmachine.<anonymous>:0:0)
    at self.callback (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:189:7)
    at Request.onRequestError (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:189:7)
    at TLSSocket.socketErrorListener (_http_client.js:358:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:189:7)
    at connectErrorNT (net.js:1025:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

$
« Last Edit: June 27, 2017, 05:42:08 PM by AlfonseX »
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #5 on: June 27, 2017, 05:44:55 PM »
Nice. I'm testing it now.

Seems to work. Great work. Not seeing any 422 errors.

It does use lot's of CPU, that would be nice to get down little bit.

Yeah, it needs some optimization, I have some ideas in mind, will test over the next few days.

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #6 on: June 27, 2017, 05:45:24 PM »
Wow, great job Kevin  :)
I will test it as soon as possible.

Just a question, in the README you say:
Quote
Create a new poloniex api key: https://poloniex.com/apiKeys

Why? Can't use an existing API Key? I'm not sure.

When you make a new key, the nonce starts at 0, but it will still work with an existing key.

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #7 on: June 27, 2017, 05:46:30 PM »
Encouter this error:
Code: [Select]
Traceback (most recent call last):
  File "polproxy.py", line 5, in <module>
    from urllib.parse import urlencode
ImportError: No module named parse

Ok, I made:
Code: [Select]
sudo python3 polproxy.pythat solve this error.

But now GB fired me:
Code: [Select]
Creating market client for BTC_BCN pair
Activating hot reconfig...
###[ --2017/06/27 18:34:28--poloniex--BTC_BCN  --  Gunbot v3.3 cycle #1 --------------- ]
::::: collecting market data...
Server running at http://127.0.0.1:39873
(node:5606) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188
      self._callback.apply(self, arguments)
                     ^

TypeError: Cannot read property 'statusCode' of undefined
    at Request._callback (evalmachine.<anonymous>:0:0)
    at self.callback (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:189:7)
    at Request.onRequestError (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:189:7)
    at TLSSocket.socketErrorListener (_http_client.js:358:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:189:7)
    at connectErrorNT (net.js:1025:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

$

I'm not sure, not encountered that issue, have to head out, but can help you out later this evening.

Offline citedjade

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #8 on: June 27, 2017, 07:13:50 PM »
thanks! facing a problem when using it with mac.
terminal always stay at "Updating polo ip".
seems missing some configs in my mac. can write a guide for mac-user?

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #9 on: June 27, 2017, 07:15:33 PM »
Encouter this error:
Code: [Select]
Traceback (most recent call last):
  File "polproxy.py", line 5, in <module>
    from urllib.parse import urlencode
ImportError: No module named parse

Ok, I made:
Code: [Select]
sudo python3 polproxy.pythat solve this error.

But now GB fired me:
Code: [Select]
Creating market client for BTC_BCN pair
Activating hot reconfig...
###[ --2017/06/27 18:34:28--poloniex--BTC_BCN  --  Gunbot v3.3 cycle #1 --------------- ]
::::: collecting market data...
Server running at http://127.0.0.1:39873
(node:5606) DeprecationWarning: Calling an asynchronous function without callback is deprecated.
/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188
      self._callback.apply(self, arguments)
                     ^

TypeError: Cannot read property 'statusCode' of undefined
    at Request._callback (evalmachine.<anonymous>:0:0)
    at self.callback (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:189:7)
    at Request.onRequestError (/snapshot/Users/Enrico/Desktop/xBot_v2.9.3/node_modules/request/request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:189:7)
    at TLSSocket.socketErrorListener (_http_client.js:358:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:189:7)
    at connectErrorNT (net.js:1025:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

$

Ok, I'm back, do you see anything in the polproxy.py window ? Any errors there?

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #10 on: June 27, 2017, 07:24:05 PM »
thanks! facing a problem when using it with mac.
terminal always stay at "Updating polo ip".
seems missing some configs in my mac. can write a guide for mac-user?

Hi, unfortunately I don't have access to a Mac.

The "Updating polo ip." tries to get the poloniex IP using dig then pipes it through head to get just the IP address,

If you run the command in a terminal do you get the IP ? dig @8.8.8.8 +short poloniex.com | head -1

Offline citedjade

  • Rookie
  • *
  • Posts: 3
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #11 on: June 27, 2017, 07:34:17 PM »
thanks! facing a problem when using it with mac.
terminal always stay at "Updating polo ip".
seems missing some configs in my mac. can write a guide for mac-user?

Hi, unfortunately I don't have access to a Mac.

The "Updating polo ip." tries to get the poloniex IP using dig then pipes it through head to get just the IP address,

If you run the command in a terminal do you get the IP ? dig @8.8.8.8 +short poloniex.com | head -1

oh... it return 104.20.13.48.
should it return 127.0.0.1?  seems that my dnsmasq is not working

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #12 on: June 27, 2017, 07:37:48 PM »
thanks! facing a problem when using it with mac.
terminal always stay at "Updating polo ip".
seems missing some configs in my mac. can write a guide for mac-user?

Hi, unfortunately I don't have access to a Mac.

The "Updating polo ip." tries to get the poloniex IP using dig then pipes it through head to get just the IP address,

If you run the command in a terminal do you get the IP ? dig @8.8.8.8 +short poloniex.com | head -1

oh... it return 104.20.13.48.
should it return 127.0.0.1?  seems that my dnsmasq is not working

It should return 104.20.13.48. Basically, we are telling dig to ask 8.8.8.8 (google) what the poloniex IP is.
You can use dig +short poloniex.com to check if dnsmasq is working.

If you want to see what DNS server was used :
dig poloniex.com | grep -i server
« Last Edit: June 27, 2017, 07:41:39 PM by kevinlekiller »

Offline kevinlekiller

  • Rookie
  • *
  • Posts: 8
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #13 on: June 27, 2017, 09:20:01 PM »
Nice. I'm testing it now.

Seems to work. Great work. Not seeing any 422 errors.

It does use lot's of CPU, that would be nice to get down little bit.

Cpu usage should be better now.

Offline Seki92

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #14 on: June 27, 2017, 10:49:54 PM »
how can i dow  :'( :'( :'(

Traceback (most recent call last):
  File "polproxy.py", line 3, in <module>
    import hmac, hashlib, os.path, pycurl, re, socket, ssl, subprocess, sys, threading, time, yaml
ImportError: No module named 'yaml'

Offline botreminer0011

  • Rookie
  • *
  • Posts: 15
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #15 on: June 27, 2017, 10:54:53 PM »
how can i dow  :'( :'( :'(

Traceback (most recent call last):
  File "polproxy.py", line 3, in <module>
    import hmac, hashlib, os.path, pycurl, re, socket, ssl, subprocess, sys, threading, time, yaml
ImportError: No module named 'yaml'


Install dnsmasq / dig (dnsutils in arch linux) / python 3 / pycurl (python-pycurl in arch, or use pip install pycurl on other distros) / pyyaml (python-yaml in arch or pip install pyyaml other distros)


Offline Seki92

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #16 on: June 28, 2017, 01:04:49 AM »
dont working after this

Grimdin

  • Guest
Re: Linux proxy for 422 errors.
« Reply #17 on: June 28, 2017, 03:28:53 PM »
Nice. I'm testing it now.

Seems to work. Great work. Not seeing any 422 errors.

It does use lot's of CPU, that would be nice to get down little bit.

Cpu usage should be better now.

Yes it is, much better, thx!

Was running it over night and founded it crashed on morning, some sort of memory leak i assume.

I have now latest version (from github) running, did have problems starting it (nonce errors), but after re-start it managed to get past it.

Ok, now i am seeing "socket hang up" errors in gunbot, too low bot delay?

Offline AlfonseX

  • Contributor
  • **
  • Posts: 101
  • Trop de chefs, pas assez d'indiens !
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #18 on: June 28, 2017, 05:07:34 PM »
dont working after this

Have you tried to run like:
Code: [Select]
sudo python3 polproxy.py
If you think I helped you, give me a drink:
in btc: 12aeQSpytxoehCEptQE8tUJVVSAS42LvXo
in eth: 0x02a611f0c15bccdb6fa8e5e4b0692ff6d77852bd

Offline Seki92

  • Rookie
  • *
  • Posts: 7
    • View Profile
Re: Linux proxy for 422 errors.
« Reply #19 on: June 28, 2017, 10:18:58 PM »
no look

Traceback (most recent call last):
  File "polproxy.py", line 3, in <module>
    import hmac, hashlib, os.path, pycurl, re, socket, ssl, subprocess, sys, threading, time, yaml
ImportError: No module named 'pycurl'