WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -166,7 +167,7 @@ force_polling: true # Force the use of the polling a
166
167
relative:false# Whether changes should be relative to current dir or not
167
168
# default: false
168
169
169
-
debug:true# Enable Celluloid logger
170
+
debug:true# Enable Listen logger
170
171
# default: false
171
172
172
173
polling_fallback_message:'custom message'# Set a custom polling fallback message (or disable it with false)
@@ -247,47 +248,6 @@ Also, if the directories you're watching contain many files, make sure you're:
247
248
248
249
When in doubt, LISTEN_GEM_DEBUGGING=2 can help discover the actual events and time they happened.
249
250
250
-
## Forwarding file events over TCP
251
-
252
-
Listen is capable of forwarding file events over the network using a messaging protocol. This can be useful for virtualized development environments when file events are unavailable, as is the case with shared folders in VMs.
253
-
254
-
[Vagrant](https://github.com/mitchellh/vagrant) uses Listen in it's rsync-auto mode to solve this issue.
255
-
256
-
To broadcast events over TCP programmatically, use the `forward_to` option with an address - just a port or a hostname/port combination:
# After broadcasting the changes to any connected recipients,
261
-
# this block will still be called
262
-
end
263
-
listener.start
264
-
sleep
265
-
```
266
-
267
-
As a convenience, the `listen` script is supplied which listens to a directory and forwards the events to a network address
268
-
269
-
```bash
270
-
listen -f "10.0.0.2:4000"# changes in current directory are sent as absolute paths
271
-
listen -r -f "10.0.0.2:4000"# changes in current directory are sent as relative paths
272
-
listen -v -d "/projects/my_project" -f "10.0.0.2:4000"# changes in given directory are also shown
273
-
```
274
-
275
-
*NOTE: if you are using a gem like `guard` and the paths on host and guest are not exactly the same, you'll generally want to use the `-r` option for relative paths*
276
-
277
-
To connect to a broadcasting listener as a recipient, specify its address using `Listen.on`:
Since file events potentially expose sensitive information, care must be taken when specifying the broadcaster address. It is recommended to **always** specify a hostname and make sure it is as specific as possible to reduce any undesirable eavesdropping.
290
-
291
251
## Development
292
252
293
253
* Documentation hosted at [RubyDoc](http://rubydoc.info/github/guard/listen/master/frames).
0 commit comments