Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we use recorder plugin for one node of chain #587

Open
nbg1rp opened this issue Sep 30, 2024 · 3 comments
Open

Can we use recorder plugin for one node of chain #587

nbg1rp opened this issue Sep 30, 2024 · 3 comments

Comments

@nbg1rp
Copy link

nbg1rp commented Sep 30, 2024

  1. great tool! Much appreciated for the author and team!
  2. can we use recorder plugin for one node of chain( name: node-1 in the conf) ? pls check below conf.
  3. what I want is use bypasses to split traffic into 2 kinds, direct out or proxy out, and record the outgoing domain correspondingly, is there any better way to reach this goal?
services:
- name: service-3000
  addr: "127.0.0.1:3000"
  handler:
    type: http
    chain: chain-3000
  listener:
    type: tcp

- name: service-13000
  addr: "127.0.0.1:13000"
  recorders:
  - name: recorder-zl-all
    record: recorder.service.router.dial.address
  - name: recorder-zl-err
    record: recorder.service.router.dial.address.error
  handler:
    type: http
  listener:
    type: tcp

chains:
- name: chain-3000
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      bypass: bypass-2
      addr: "127.0.0.1:13000"
      connector:
        type: http
      dialer:
        type: tcp
    - name: node-1
      bypass: bypass-1
      addr: ":7890"
      recorders:
      - name: recorder-px-all
        record: recorder.service.router.dial.address
      - name: recorder-px-err
        record: recorder.service.router.dial.address.error
      connector:
        type: http
        auth:
          username: "[user]"
          password: "[pass]"
      dialer:
        type: tcp

recorders:
- name: recorder-zl-all
  redis:
    addr: 123.124.125.126:6379
    db: 1
    password: myredispwd
    key: gg_zl_all
    type: set
- name: recorder-zl-err
  redis:
    addr: 123.124.125.126:6379
    db: 1
    password: myredispwd
    key: gg_zl_err
    type: set
- name: recorder-px-all
  redis:
    addr: 123.124.125.126:6379
    db: 1
    password: myredispwd
    key: gg_px_all
    type: set
- name: recorder-px-err
  redis:
    addr: 123.124.125.126:6379
    db: 1
    password: myredispwd
    key: gg_px_err
    type: set

bypasses:
- name: bypass-1
  reload: 60s
  whitelist: false
  file:
    path: /path/to/file
- name: bypass-2
  reload: 60s
  whitelist: true
  file:
    path: /path/to/file
@ginuerzh
Copy link
Member

A more powerful and flexible option is to use a handler recorder, which will record more details. Please see:
https://gost.run/en/concepts/recorder/#recorderservicehandler and https://gost.run/en/tutorials/sniffing/.

@nbg1rp
Copy link
Author

nbg1rp commented Oct 16, 2024

Thanks for your response! For the question 3, could you help to figure out a better way? In this configure, the traffic need to go through 2 hops( the port 3000 and port 13000), is there any way to let the direct traffic part just go through port 3000 and send out.

@nbg1rp
Copy link
Author

nbg1rp commented Oct 16, 2024

A more powerful and flexible option is to use a handler recorder, which will record more details. Please see: https://gost.run/en/concepts/recorder/#recorderservicehandler and https://gost.run/en/tutorials/sniffing/.

And for you reply, maybe you misunderstanding what I said, I would like to record one node in the chain ( for successful connections and failed connections)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants