EzDevInfo.com

relay

Relay is a JavaScript framework for building data-driven React applications. Relay | A JavaScript framework for building data-driven React applications

IIS SMTP - The server response was: 5.7.1 Unable to relay for outgoing address, Still not working

I saw

Mailbox unavailable. The server response was: 5.7.1 Unable to relay for abc@xyz.com

and all of the answers, and I have added my ip on

IIS-->Default SMTP Virtual Server-->Properties-->Access-->Relay restrictions just add or exclude >the IPs you care about, should resolve the issue.

but it still gives me the error as above. what is wrong?

Im using Windows Sever 2003 R2 and IIS6

thanks!


Source: (StackOverflow)

How does WebRTC handle many-to-many connections?

if I am in a room with other 7 users, I am wondering if WebRTC force every user to establish a connection to each one of other participants.

Obviously it would consume something like 7kb/s*7 download and even upload, and many connection cannot handle this if their connection is already busy. Instead with some kind of media relay the bandwidth usage would be only 7kb/s but you would lose bandwidth adaptation between peers.

Do you know any media relay, or way to solve this problem? is TURN server ( like https://code.google.com/p/rfc5766-turn-server/ ) suitable for this kind of job ( multicast included )?


Source: (StackOverflow)

Advertisements

How to make the simplest software-controlled ON/OFF hardware with Java? [closed]

I want to make the simplest and most reliable on/off device controlled from a compuer software (Java).

I was thinking about sinus sound singnal + RC filter with relay for specific frequency, but unfortunatelly I can't use sound card - it is already occupied for different purposes.

How can I achieve this without much compatibility/reliability issues. It should work both on Unix and Windows

I mean an output device, so I want to turn on/off relay from Java software.


Source: (StackOverflow)

kernel-based (Linux) data relay between two TCP sockets

I wrote TCP relay server which works like peer-to-peer router (supernode).

The simplest case are two opened sockets and data relay between them:

clientA <---> server <---> clientB

However the server have to serve about 2000 such A-B pairs, ie. 4000 sockets...

There are two well known data stream relay implementations in userland (based on socketA.recv() --> socketB.send() and socketB.recv() --> socketA.send()):

  • using of select / poll functions (non-blocking method)
  • using of threads / forks (blocking method)

I used threads so in the worst case the server creates 2*2000 threads! I had to limit stack size and it works but is it right solution?

Core of my question:

Is there a way to avoid active data relaying between two sockets in userland?

It seems there is a passive way. For example I can create file descriptor from each socket, create two pipes and use dup2() - the same method like stdin/out redirecting. Then two threads are useless for data relay and can be finished/closed. The question is if the server should ever close sockets and pipes and how to know when the pipe is broken to log the fact?

I've also found "socket pairs" but I am not sure about it for my purpose.

What solution would you advice to off-load the userland and limit amount fo threads?

Some extra explanations:

  • The server has defined static routing table (eg. ID_A with ID_B - paired identifiers). Client A connects to the server and sends ID_A. Then the server waits for client B. When A and B are paired (both sockets opened) the server starts the data relay.
  • Clients are simple devices behind symmetric NAT therefore N2N protocol or NAT traversal techniques are too complex for them.

Thanks to Gerhard Rieger I have the hint:

I am aware of two kernel space ways to avoid read/write, recv/send in user space:

  • sendfile
  • splice

Both have restrictions regarding type of file descriptor.

dup2 will not help to do something in kernel, AFAIK.

Man pages: splice(2) splice(2) vmsplice(2) sendfile(2) tee(2)

Related links:


Source: (StackOverflow)

Relay access denied on sending mail, Other domain outside of network

Sending mail results in error "Relay access denied".

It throws "Relay access denied", whenever I tried to send mail to "other_domain" from "outside_network". It works just fine for "myown_domain" from "outside/inside_network" and to "other_domain" from "inside_network".

Here is the list of telnet commands.

mail from:myself@mydomain.com
- 250 2.1.0 Ok
rcpt to:yourself@mydomain.com
- 250 2.1.5 Ok
rcpt to:yourself@yourdomain.com
- 554 5.7.1 <yourself@yourdomain.com>: Relay access denied.
rcpt to:yourself@gmail.com
- 554 5.7.1 <yourself@gmail.com>: Relay access denied.
rcpt to:yourself@yahoo.com
- 554 5.7.1 <yourself@yahoo.com>: Relay access denied.

I followed all the steps described in "Microsoft Support" and make sure that server configured in correct way and it do not reject any mail. I also tried to trace through using couple of blogs like this one.

While using MxToolbox also got the same result "Relay access denied".

As "Relay access denied" is very common issue.. there are lot of blogs/documentation are there.. I tried to read all, but I think I am looking in wrong place.

Does anybody have any suggestion?


Source: (StackOverflow)

How to design and implement a simple WCF service relay?

We are in the process of designing a simple service-oriented architecture using WCF as the implementation framework. There are a handful of services that a few applications use. These services are mostly used internally, so a basic authentication and authorization scheme (such as Windows-based) is enough.

We want, however, expose some of the services to some business partners. The set of services they have access to depend on the contract. Kind of a standard architecture.

I think we can implement a service gateway which authenticates the requests and relays them to the correct internal service endpoint (this resembles simple ESB), so we can centralize the authentication/authorization code and expose one single endpoint to the world. I looked at some available ESB toolkits, but they seem way too complex for this purpose. We do not need to integrate a lot of different services, but just to expose some of them to the Internet.

How can I design and implement such a relay/router in WCF, keeping it very simple? I have read Inside Windows Communication Foundation, which is a good book, but I'm still not confident enough on how to begin.


Source: (StackOverflow)

PLC ladder logic sequence

I've spent hours and a trees worth of paper sketching and I haven't been able to stumble upon anything to get me past this problem. I'm able to switch back and forth between two motors but I can't figure out how to turn the motors off while switching between them, while still following the criteria below.

Using ladder logic: Use only one start stop station consisting of only one NC contact and one NO contact, two motor starters and three control relays create the following cycle. (No timers or counters)

  1. When the start button is pressed motor 1 will start and run until stopped by pressing the stop button.
  2. When the start button is pressed again motor 2 will run until stopped by pressing the stop button.
  3. When the start button is pressed again motors 1 & 2 will run until stopped by pressing the stop button. Pressing the start button again will now start the cycle over.

Any help is very appreciated.

Thank you


Source: (StackOverflow)

HTTP Server behind NATs

I'm trying to make an (apache) server behind multi-layered NAT to be accessible from Internet.

Restrictions:

  1. Avoid relay. There is a public server (we call him the OldMan) for login / stun, but its bandwidth is too poor to carry relay data.
  2. I have no right to configure the NATs manually. 3.User don't have to change their browser or device.(that is, works on android, ios, and any PC)

I tried UPnP, but it only works on 1-layered NAT.

I tried to search NAT traversal solutions for several months, but in vain.

I study STUN/TURN/ICE,and tried pjsip (icedemo.exe + numb), however, its stun cannot punch through 2-layered NAT.

I tried Mist,Pwnat, but with no luck. And libjingle sounds like an API for making Gtalk extension as I know...(?)

I also tried to a make VPN/N2N to solve this, but this will be a heavy overloading to the public server. Any VPN client requires the server(the OldMan server) to relay all the packets to another, isn't it?

Is there any solutions to solve this problem? A HTTP server behind multi-layered NATs.

BTW, if the STUN/TURN/ICE works,my idea is as the following ,is it possible?

  1. User installed an application (ex:stun_browser_agent.exe)
  2. user type the following address on Chrome: 127.0.0.1:9999
  3. Chrome connected to stun_browser_agent.exe daemon
  4. daemon connect to HTTP Server with Stun protocol
  5. A daemon on Http Server(ex: stun_apache_agent.exe) receive all the message and relay it to Apache daemon.
  6. Apache reply all the http infomation -->stun_apache_agent.exe-->stun_browser_agent.exe-->chrome

Then we won't have to modify the browser and Apache.

Any available resource I can refer to implement this?

Thank you for your patience


Source: (StackOverflow)

Twisted tcp tunnel/bridge/relay

I'd like to know how to write TCP tunnel/relay/bridge/proxy (you name it) using twisted.

I did some research in google, twisted doc/forum etc. etc but couldn't find anwser.

I already done it in pure python using socket, threading and select.

Here is code:

#!/usr/bin/env python

import socket
import sys
import select
import threading
import logging
import time


class Client(threading.Thread):
    def __init__(self, client, address, id_number, dst_ip, dst_port):
        self.log = logging.getLogger(__name__+'.client-%s' % id_number)
        self.running = False
        self.cl_soc = client
        self.cl_adr = address
        self.my_id = id_number
        self.dst_ip = dst_ip
        self.dst_port = dst_port
        threading.Thread.__init__(self)

    def stop(self):
        self.running = 0

    def run(self):
        try:
            self.dst_soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.dst_soc.connect((self.dst_ip,self.dst_port))
        except:
            self.log.error('Can\'t connect to %s:%s' % (self.dst_ip, self.dst_port))
        else:
            self.running = True
            self.log.info('Bridge %s <-> %s created' % (
                '%s:%s' % self.dst_soc.getpeername(), '%s:%s' % self.cl_adr))

        try:
            while self.running:
                iRdy = select.select([self.cl_soc, self.dst_soc],[],[], 1)[0]

                if self.cl_soc in iRdy:
                    buf = self.cl_soc.recv(4096)
                    if not buf:
                        info = 'Ended connection: client'
                        self.running = False
                    else:
                        self.dst_soc.send(buf)

                if self.dst_soc in iRdy:
                    buf = self.dst_soc.recv(4096)
                    if not buf:
                        info = 'Ended connection: destination'
                        self.running = False
                    else:
                        self.cl_soc.send(buf)


        except:
            self.log.error('Sth bad happend', exc_info=True)
            self.running = False

        self.log.debug('Closing sockets')
        try:
            self.dst_soc.close()
        except:
            pass

        try:
            self.cl_soc.close()
        except:
            pass


class Server(threading.Thread):
    def __init__(self, l_port=25565, d_ip='127.0.0.1', d_port=None):
        self.log = logging.getLogger(__name__+'.server-%s:%s' % (d_ip,d_port))
        threading.Thread.__init__(self)
        self.d_ip = d_ip
        if d_port == None:
            self.d_port = l_port
        else:
            self.d_port = d_port

        self.port = l_port
        binding = 1
        wait = 30
        self.s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.s.setsockopt(socket.SOL_SOCKET,  socket.SO_REUSEADDR,  1)
        while binding:
            try:
                self.s.bind(('',self.port))
            except:
                self.log.warning('Cant bind. Will wait %s sec' % wait)
                time.sleep(wait)
            else:
                binding = 0
                self.log.info('Server ready for connections - port %s' % d_port)

    def run(self):
        self.s.listen(5)
        input = [self.s, sys.stdin]
        running = 1
        self.cl_threads = []
        id_nr = 0

        while running:
            iRdy = select.select(input, [], [],1)[0]
            if self.s in iRdy:
                c_soc, c_adr = self.s.accept()
                c = Client(c_soc, c_adr, id_nr, self.d_ip, self.d_port)
                c.start()
                self.cl_threads.append(c)
                id_nr += 1

            if sys.stdin in iRdy:
                junk = sys.stdin.readline()
                print junk
                running = 0

        try:
            self.s.close()
        except:
            pass


        for c in self.cl_threads:
            c.stop()
            c.join(5)
            del c

        self.cl_threads = None

        self.log.info('Closing server')


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)
    s = Server(1424, '192.168.1.6', 1424)
    s.run()

Source: (StackOverflow)

Why is my Arduino freezing when using a relay board?

I'm working on a project where I use midi notes to switch 8 old lamps using the Arduino Uno. I've built a case with 8 wall sockets that are linked up to a relay board for the Arduino. I am using the Hairless midi serial bridge to send midi notes via USB to the Arduino.

This all works until I put power on the sockets with my Uno. After about 5~10 seconds the Arduino freezes. The relay shield stays in it's current state and the indication lights for serial communication stop flashing. When there isn't 220 volts going through the relays it all works great.

(My schematics are below.) The Arduino is powered via USB. I also tried powering the Arduino with an additional adapter of 5V and 500mA but that didn't make a difference.

Code:

#include <digitalWriteFast.h>

byte incomingByte=0;
byte notebyte=0;
byte velocitybyte=0;
byte statusbuffer=0;
byte NOTE_ON = 144;
byte NOTE_OFF = 128;
boolean arp_triggernext=false;
boolean firstbyte;
void MIDI_Poll(){
  if (Serial.available() > 0) {
    do {
      // read the incoming byte:
      incomingByte = Serial.read();
      if (incomingByte>247) {
        // this is where MIDI clock stuff is done
        switch (incomingByte){
        }
      }
      else if (incomingByte>240) {
        statusbuffer = 0;
        //sysex stuff done here
      }
      else if (incomingByte>127) {
        statusbuffer = incomingByte;
        firstbyte = true;
        notebyte = 0;
        velocitybyte = 0;
      }
      else if (statusbuffer!=0) {
        if (firstbyte == true) {
          // must be first byte
          notebyte = incomingByte;
          firstbyte = false;
        }
        else {
          // so must be second byte then
          velocitybyte = incomingByte;
          //process the message here
          if (statusbuffer == NOTE_ON && velocitybyte != 0) {
            switch (notebyte) {
               case 60:
               digitalWriteFast2(2, HIGH);
               break;
               case 61:
               digitalWriteFast2(3, HIGH);
               break;
               case 62:
               digitalWriteFast2(4, HIGH);
               break;
               case 63:
               digitalWriteFast2(5, HIGH);
               break;
               case 64:
               digitalWriteFast2(6, HIGH);
               break;
               case 65:
               digitalWriteFast2(7, HIGH);
               break;
               case 66:
               digitalWriteFast2(8, HIGH);
               break;
               case 67:
               digitalWriteFast2(9, HIGH);
               break;
            }
          }
          else if (statusbuffer == NOTE_OFF || (statusbuffer == NOTE_ON && velocitybyte == 0)) {
            switch (notebyte){
               case 60:
               digitalWriteFast2(2, LOW);
               break;
               case 61:
               digitalWriteFast2(3, LOW);
               break;
               case 62:
               digitalWriteFast2(4, LOW);
               break;
               case 63:
               digitalWriteFast2(5, LOW);
               break;
               case 64:
               digitalWriteFast2(6, LOW);
               break;
               case 65:
               digitalWriteFast2(7, LOW);
               break;
               case 66:
               digitalWriteFast2(8, LOW);
               break;
               case 67:
               digitalWriteFast2(9, LOW);
               break;
            }
          }
          //now clear them for next note
          notebyte = 0;
          velocitybyte = 0;
          firstbyte = true;        
        }
      }
    } while (Serial.available() > 0);
  }
}

void setup() {      

  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  MIDI_Poll();
}

It's based on code I've found for processing serial midi.

I'm really confused as to why this happens. I want to know why my Arduino and relay board freeze when there is 220 volts going through the relays.

Materials:


Source: (StackOverflow)

How to access IMAP email through an email proxy server

I'm not 100% certain how to phrase the question, so let me start with what I'm trying to do and the barriers:

Goal:

  • Read/Answer mail from "another account" in GMail by adding a new email account into gmail

Won't work:

  • Forwarding email from "another account" to a new gmail account and then changing the "reply-to" label. it looks ugly on the receiving end and does not sync up sent messages. I've tried this. It works 'ok', just not the idea solution

Barrier to success

  • "another account" doesn't have open/external POP3 or IMAP interfaces.

Available to me

  • IMAP service enabled on the other account, but only available through VPN. So while on VPN I can actually access the other account with Outlook via IMAP.

Theoretical plan

  1. Run a pc 24/7 logged in to the VPN and has visibility to the IMAP
  2. Run some kind of Mail Relay Proxy Server thing-a-ma-bop (?!)
  3. Point GMail to above "mail server"

Is there something that works like #2 above? I have no idea how to search for it. Maybe it's a combo of things? Some kind of setup of WinProxy, javamail and ... ? No idea if this is even possible.

Thank you

Edit:

More searching, found "FreePOPs", but it's not quite there, sounds like what I might need. FreePOPs connects to webmails, and my account does have it, but... it's Lotus iNotes and FreePOPs doesn't seem to support it.

1) Do you know how to make FreePOPs support lotus inotes? 2) Or, is there another product like FreePOPs that's an "email relay" and a pop3 daemon?


Source: (StackOverflow)

Fetch value from website and control relay?

I got a quite unusual question today from a client. They provide a mission-critical service where it's important that people are notified when a certain event happens. Currently they have an API that simply writes out TRUE or FALSE, when accessed by a web browser, depending on the state of their alert.

They want to take this even further, so they want to have a PC which would fetch the value from their existing API on a continuous basis, and depending on the value, toggle a relay, which would turn on/off an alarm or warning light in their office.

I have no idea of how one could build such a thing, as I work only on web applications. It doesn't sound like a project requiring too many braincells, but certainly a challenge for me. What languages do I need to learn to accomplish something like this?


Source: (StackOverflow)

Why is Authorize.net throwing an error when my relay response URL points to a CodeIgniter controller and not otherwise?

I'm not typically a web developer, but I'm a decent enough coder that I felt comfortable accepting a proposal from a friend to develop his brother's small business website. I'm nearly finished and I've been using CodeIgniter, which has been a huge help and was easy to jump into.

They have a handful of products they'd like available for purchase via the site, their preference was Auth.net (which I have no previous experience with), and their host does not support SSL (nearlyfreespeech.net), so I decided that Auth.net's SIM was appropriate. If I test SIM outside of the CI application with a relay response page which simply spits out the available transaction details, everything goes as expected. If I try it with the relay response page set to a CI controller/method which simply echoes a string, Auth.net displays the following 'error':

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service.

My initial thought was that perhaps the rewrite rule I set up to circumvent having to include the index.php front controller was the issue, so I tried including it in the relay response URL with no change. I should also note that the controller in question implements a _remap() method, but the relay response method shouldn't be affected by it as it doesn't match it's regex.

Any insight(s) would be greatly appreciated.


Source: (StackOverflow)

Existing TCP Relay Solutions

I have a scenario which requires the use of a TCP Relay. Before I set out to write something custom, I wanted to see if anyone knows of existing software that can do this for me.

I have 2 devices on separate networks that cannot connect to each other. Let's call them networks A and B. These devices need to communicate, and they can do so via a "middleman" relay on network C. A can connect to C, and B can connect to C. C cannot connect to either A or B.

A -> C <- B

The idea is as follows:

  1. A establishes a TCP connection to C and simply waits
  2. B establishes a TCP connection to C when it wants something from A.
  3. C reads the data from B and responds with it to the already open connection from A.
  4. A processes the data and responds to C, which relays to B.

Is there an existing tool out there that can do this?


Source: (StackOverflow)

Connect iOS App SAP-SUP through Relay Server

I´m trying to connect to SAP-SUP trough a relay server and i followed the How-To: Transitioning Existing Object API Applications to Mobile SDK 2.1 ESD #3 i registered with success the application but i can´t synchronize. I keep getting the error 216 or 219 like this:

(MOBILINK_COMMUNICATIONS_ERROR) %1:219 %2: %3:0Details: StreamErrorCode = 219

216 stands for - An error occurred while trying to parse an HTTP header. The header may be malformed.

219 stands for - An unexpected character was read in an HTTP header. The header may be malformed or the other side may not be sending HTTP at all.

SUPConnectionProfile *sp = [RHDC1RHDC1DB getSynchronizationProfile];

[sp setAsyncReplay:NO];
[sp setUser:kSUPLoginUsername];
[sp setPassword:kSUPLoginPassword];
[sp setServerName:kSUPServerName];
[sp setPortNumber:kSUPServerPort];    
[sp setNetworkProtocol:@"https"];
[sp setNetworkStreamParams:@"trusted_certificates=afaria.xpto.en.cer;compression=zlib;url_suffix=/ias_relay_server/server/rs_server.dll/SUPRBSFarm"];   

The NetworkStreamParameters seem fine. I can´t find the error on that line! As anyone successfully connected through a relay server? Or can find the error in my code?


Source: (StackOverflow)